My personal macOS dotfiles managed declaratively with Nix flakes through nix-darwin backed by home-manager.
nix/
├── flake.nix # Main flake config
├── darwin/ # macOS system settings
│ ├── default.nix
│ ├── settings.nix
│ └── homebrew.nix
├── home/ # Home Manager config
│ ├── default.nix # contains non-configured packages as well
│ ├── shell.nix
│ └── <program>.nix
└── hosts/
└── mbp/
├── configuration.nix
└── shell-functions.sh
- Install Nix (docs)
- Clone this repo to
~/.config/nix
- Edit names/usernames around (eg.
flake.nix
andhome/git.nix
) - Run:
darwin-rebuild switch --flake .#mbp
- Or nix-darwin directly for the first time run:
sudo nix run nix-darwin --extra-experimental-features nix-command --extra-experimental-features flakes -- switch --flake ~/.config/nix
- CLI tools:
home/default.nix
- GUI apps:
darwin/homebrew.nix
- Host config:
hosts/mbp/configuration.nix
See Nix manual. Original files from bgub.