A fully declarative macOS development environment built on Nix flakes and nix-darwin. Organised with the dendritic pattern on top of flake-parts and import-tree — drop a .nix file in the right place and it's picked up automatically.
Layered under modules/system/darwin/:
0-base— core macOS system setup and app fixes1-shell— system-level shell configuration2-tools— system-level CLI tools3-desktop— desktop settings, fonts, keyboard, security, and macOS defaults
Per-program modules under modules/programs/:
- Editor / shell: Neovim, Zsh, Starship, Tmux, Kitty
- Navigation: fzf, zoxide, yazi, eza
- Git workflow: Git, LazyGit, LazyDocker
- Window management: AeroSpace (i3-like tiling WM for macOS)
- Dev ergonomics: direnv, lazyhis
- Nix (via flakes)
- Homebrew (via nix-homebrew)
flake.nix # minimal entry point — imports ./modules via import-tree
modules/
├── nix/ # flake-parts setup, home-manager & nix-homebrew integration
├── system/darwin/ # nix-darwin system layers (0-base … 3-desktop)
├── programs/ # per-program home-manager modules
├── users/ # per-user home-manager configs (norbertbatiuk, work)
└── hosts/ # per-host darwin configs
└── macbook-pro-m1/
├── configuration.nix # host-level config
└── users/ # which users live on this host
With the dendritic pattern, every .nix file under modules/ is auto-imported — there is no central import list to maintain. flake.nix simply hands the tree to flake-parts.
Install nix from the official installer:
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install)or, simply run:
make installThe following command will build and apply the full macOS configuration using nix-darwin:
make switchThis defaults to the macbook-pro-m1 host (see HNAME in the Makefile) and is equivalent to:
sudo darwin-rebuild switch --flake .#macbook-pro-m1To target a different host, override HNAME:
make switch HNAME=<hostname>The hostname must match a host defined under modules/hosts/.
Run once after cloning to install the pre-commit formatter hook:
nix run .#install-hooksmake check # nix flake check
make update # nix flake update
make clean # nix-store --gc
make uninstall # remove nix-darwin- New host: create
modules/hosts/<hostname>/configuration.nixfollowing the pattern inmacbook-pro-m1, then addmodules/hosts/<hostname>/users/<user>.nixbinding files for each user on that host. - New user: create
modules/users/<user>/with the user's home-manager config, then bind it to one or more hosts via theusers/<user>.nixfiles above.
- Dendritic Nix
- Dendritic Design with the Flake Parts Framework
- Set up Nix on macOS using flakes, nix-darwin and home-manager
- Ultimate NixOS Desktop: Niri, Noctalia Shell, and the Dendritic Pattern | Full Setup
- NixOS & Flakes Book
This very repository is intended for my personal usage. Breaking changes, change of utilities, or pattern may occur at any point.
Enjoy!