I store my dotfiles in the ~/.config directory, and manage them with nix on macOS.
Tested on macOS Sequoia 15, nix-installer v0.27 and nix v2.24.9
Run xcode-select --install on a fresh macOS install.
Install nix with the nix-installer: https://github.com/DeterminateSystems/nix-installer
Clone this repo to ~/.config
⚠️ Look through codebase to change relevant user detail (pc name, username, email, etc.)!- Run
makefrom the root directory to install all packages and setup the system
- Make changes (add apps, edit configs, etc.)
- (Optional) Run
nix flake update - Run
makefrom the root directory
alacrittyhomebrewwith bundle and caskpnpmwithzshrcoverwrite
nodejswithfnmneovimwithastronvimnix-darwin,home-managerpythonwithminicondarustzellijzshwithstarship- etc...
nixdocumentation: https://nix.dev/manual/nix/- Search
nixpackages: https://search.nixos.org/packages nix-darwindocumentation: https://daiderd.com/nix-darwin/manual/index.htmlhome-managerdocumentation: https://nix-community.github.io/home-manager/home-manageroption search: https://home-manager-options.extranix.com
You may have to run git add . in repo root first for changes to be picked up.
Most times, I follow this order:
- see if
home-managerprograms supports it - install through
home-managerpackages - use
homebrew(brew is useful for complex GUI apps like Firefox)
The nix-installer will write a /etc/nix/nix.conf file first, and nix-darwin might complain.
In that case, run sudo mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin
I use 1password to manage SSH and secrets, see https://developer.1password.com/docs/ssh/
Run sudo -i nix upgrade-nix
Run nix-collect-garbage -d