Window Management

Decknix supports several window management approaches for macOS, from full tiling to simple snapping. Pick the style that suits your workflow — they can be used individually or combined.

ToolStyleSourceDecknix module
AmethystAutomatic tiling (xmonad-style)nix-casks— (package only)
AeroSpaceManual tiling (i3-style)nixpkgsdecknix.wm.aerospace
RectangleWindow snapping (keyboard shortcuts)nix-casks— (package only)
SpaceIdMenu-bar space indicatornix-casks— (package only)
Native macOSStage Manager, Split View, Spacesbuilt-in

Amethyst

Amethyst is an automatic tiling window manager for macOS in the style of xmonad. Windows are arranged automatically into layouts (tall, wide, fullscreen, column, BSP, etc.) and reflow when windows are added or removed.

Amethyst is the recommended starting point — it works with native macOS Spaces, requires no SIP disabling, and is fully configurable via its preferences pane or defaults write.

Installation

Amethyst is not in nixpkgs; install it via nix-casks:

# home.nix (personal overrides)
{ pkgs, inputs, ... }: {
  home.packages =
    with inputs.nix-casks.packages.${pkgs.stdenv.hostPlatform.system}; [
      amethyst
    ];
}

Configuration

Amethyst stores its configuration in macOS user defaults (com.amethyst.Amethyst). Key settings:

Default keyDescription
layoutsActive layout cycle (e.g., tall, wide, fullscreen, column)
mod1Primary modifier (default: option + shift)
mod2Secondary modifier (default: ctrl + option + shift)
enables-layout-hudShow layout name on switch
window-marginsEnable gaps between windows
floatingList of app bundle IDs to float

Note — Glide: Glide is a newer tiling WM by the same author as Amethyst. It is not yet recommended for regular use and is not included in the default configuration. If you want to experiment with it, install via nix-casks and use it in place of Amethyst.

AeroSpace

AeroSpace is a manual tiling window manager inspired by i3. Unlike Amethyst's automatic layouts, AeroSpace gives you direct control over window placement using keyboard commands. It manages its own virtual workspaces (separate from macOS Spaces).

Decknix provides both home-manager and darwin modules for AeroSpace.

Enabling

# home.nix
{ ... }: {
  decknix.wm.aerospace.enable = true;
}

Options

OptionDefaultDescription
decknix.wm.aerospace.enablefalseEnable AeroSpace
decknix.wm.aerospace.prefixKey"cmd+alt"Prefix key for commands
decknix.wm.aerospace.keyStyle"emacs""emacs" (arrows) or "vim" (hjkl)
decknix.wm.aerospace.showModeHintsfalseShow mode notifications
decknix.wm.aerospace.fuzzyPicker.enabletrueSpotlight-like workspace/window picker

Workspaces

Define named workspaces with optional monitor assignment:

{ ... }: {
  decknix.wm.aerospace.workspaces = {
    "1" = { name = "Terminal"; };
    "2" = { name = "Browser"; };
    "3" = { name = "Code"; };
    "4" = { name = "Chat"; monitor = "secondary"; };
  };
}

Default workspaces: 1–5 (main, web, term, mail, chat) + D, E, N, M, S (decknix, emacs, notes, music, system).

System-Level Settings

The darwin module optimises macOS for tiling:

OptionDefaultEffect
decknix.services.aerospace.disableStageManagertruePrevents conflicts
decknix.services.aerospace.disableSeparateSpacestrueMulti-monitor support
decknix.services.aerospace.disableMissionControlShortcutstrueFrees Ctrl+arrow keys
decknix.services.aerospace.autohideDocktrueMaximises screen space

Rectangle

Rectangle is a lightweight window snapping tool. It provides keyboard shortcuts for half-screen, quarter-screen, thirds, and other arrangements — similar to Windows snap or Spectacle (which Rectangle succeeds).

Rectangle is a good choice if you prefer manual control without full tiling. It pairs well with Amethyst (use Amethyst for your main workspace and Rectangle shortcuts for quick one-off snaps).

Installation

# home.nix
{ pkgs, inputs, ... }: {
  home.packages =
    with inputs.nix-casks.packages.${pkgs.stdenv.hostPlatform.system}; [
      rectangle
    ];
}

Rectangle is configured via its preferences pane. No Decknix module is needed.

SpaceId

SpaceId shows the current macOS Space number in the menu bar. Useful alongside any window manager to keep track of which Space you're on.

Installation

# home.nix
{ pkgs, inputs, ... }: {
  home.packages =
    with inputs.nix-casks.packages.${pkgs.stdenv.hostPlatform.system}; [
      spaceid
    ];
}

Hammerspoon

Hammerspoon provides Lua-based macOS automation. Decknix uses it for space navigation bindings.

{ ... }: {
  decknix.wm.hammerspoon = {
    enable = true;
    modifier = "Meta + Ctrl";
  };
}

Generates Lua configuration with space navigation bindings.

Spaces

WM-agnostic multi-monitor workspace management with named space groups and picker scripts:

{ ... }: {
  decknix.wm.spaces.workspaces = {
    dev = {
      name = "Development";
      startSpace = 1;
      spaces = [ "terminal" "editor" "browser" ];
      key = "d";
    };
  };
}

Generates space picker scripts with shortcodes for quick switching. Works with any WM or standalone.