Skip to main content
The macOS system layer. Everything below it is just inputs.
Language: Nix  ·  Status: active  ·  Last active: this week  ·  Source on GitHub
nix-darwin is the top-level system layer for Macs. Run darwin-rebuild switch to apply its declared configuration.

What it does

  • Manages environment.systemPackages: the global PATH baseline
  • Owns macOS defaults: dock, finder, screenshots, keyboard, trackpad
  • Imports nix-home as home-manager input for user-level config
  • Imports nix-ai for AI tooling that should live on the system PATH
  • Pins the nixpkgs channel and applies overlays once for the whole machine
  • Runs the dev.local.ws-monitor LaunchDaemon, which saves WindowServer captures on a freeze (module)
  • Enables tailspin during activation

How it fits

The orchestrator. If a tool needs to be on every shell session by default, it belongs here.

Dock apps and their providers

Every Dock entry names the provider that installs it, and a build-time assertion on every host checks the pair. The Dock list in persistent-apps.nix is derived from those entries. The contract lives in lib/dock-apps.nix. The dock-providers flake check runs the contract against a fixture for each failure mode and confirms every Mac host carries the assertion. The macOS build job on main runs nix flake check. It builds each checks.aarch64-darwin output, including dock-providers and system-eval. The latter asserts the contract for every host. A check declared in flake.nix runs there without a second list. The Obsidian package puts its app bundle under Home Manager Apps and links the obsidian command-line tool to the app’s socket. The GUI executable is not on PATH. Workstation Homebrew cleanup runs in check mode: activation stops and lists every installed cask or formula the configuration does not declare, and removes nothing. To add or move an app, change the provider declaration and the Dock entry together.

Getting started

1

Install Nix and the Determinate installer

Use the Determinate Nix installer for flakes-enabled macOS. The README links the exact command.
2

Clone and run the bootstrap

git clone https://github.com/dryvist/nix-darwin && cd nix-darwin && darwin-rebuild switch --flake .#$(hostname -s)
3

Iterate

Edit flake.nix or any module under modules/. Re-run darwin-rebuild switch --flake .; only what changed gets rebuilt. The post-activation check compares Home Manager’s current-home link with its activation package in the new system. A mismatch fails the switch before /run/current-system advances. See the assertion.

nix-home

The user-level layer imported here.

nix-ai

The AI tooling imported here.

nix-devenv

Per-project dev shells: entered via direnv, not declared here.

Source on GitHub

Modules, host configs, full README.