Skip to content
Daniel Inama edited this page Jun 14, 2026 · 1 revision

The flake provides the package and a nix-darwin module:

# flake.nix of your system configuration
{
  inputs.agate.url = "github:frostplexx/agate-wm";

  outputs = { nix-darwin, agate, ... }: {
    darwinConfigurations.myhost = nix-darwin.lib.darwinSystem {
      modules = [
        agate.darwinModules.default
        {
          services.agate = {
            enable = true;
            # Optional: manage init.lua with Nix. Without it agate reads
            # ~/.config/agate/init.lua.
            config = ''
              agate.config({ gaps = 8, outer_gaps = 8 })
              agate.bind("hyper+l", "focus right")
            '';
            # Or point at a mutable file instead (live-editable, no rebuild):
            # configFile = "/Users/me/.config/agate/init.lua";
          };
        }
      ];
    };
  };
}

This runs agate as a launchd user agent (launchd.user.agents.agate); logs go to /tmp/agate.log / /tmp/agate.error.log (configurable via services.agate.logFile / errorLogFile).

Note

agate needs the Accessibility permission (System Settings → Privacy & Security → Accessibility). macOS grants it per binary path, and the nix store path changes when the package updates — re-grant after updates. Until granted, the agent exits and launchd keeps retrying.

nix build .#agate builds the package by itself. When build.zig.zon changes, refresh the pinned dependency hash in nix/package.nix (deps.outputHash): set it to lib.fakeHash, build, and copy the hash from the mismatch error.

Clone this wiki locally