My Mac, rebuilt with one command. Yours next.
My nix-darwin and home-manager config, set up for forking — copy the example host, add your name, run one command. Before anything changes, it shows you exactly what will.
git clone https://github.com/munza/dotfiles.git ~/.dotfiles
macOS on Apple silicon · MIT licence
What you get
Sensible defaults for a terminal-first Mac, and a switch for every app.
On for everyone
zsh- Suggestions, highlighting, shared history, search on ↑ and ↓
git- Your name and email, common settings and aliases, delta for diffs
gh- GitHub CLI and git credential helper, with gh-dash
starship- A prompt from a file you edit in place
fzfzoxideeza- Fuzzy finding, jumping to directories, a better
ls direnv- Per-project environments, cached with nix-direnv
nix-index- Which package has a missing command, and
, cmdto run it nh- Rebuild with a package diff and a confirm
fonts- JetBrains Mono Nerd Font for the terminal and editor
Opt in
ghosttyzedneovim- Terminal and editors, with Neovim configured in plain Lua
aerospace- Tiling window manager
herdr- Terminal session manager
colima- Docker in a lightweight VM, with compose and buildx
yazilazygitbtop- File manager, git TUI, resource monitor
clamav- On-demand virus scans
And on the system side: Nix with flakes and garbage collection, Homebrew installed for you, Touch ID for sudo, firewall on.
Quick start
From a fresh Mac to a working setup. I ran these on a clean macOS 26 machine before publishing.
-
Install the command line tools
Homebrew and Neovim's parsers need a compiler.
xcode-select --install -
Install Nix
sh <(curl -L https://nixos.org/nix/install) -
Clone your fork into
~/.dotfilesnhand the editable config files expect it there.git clone https://github.com/<you>/dotfiles.git ~/.dotfiles && cd ~/.dotfiles -
Copy the example host
Named after your Mac, with a user file named after your login.
host="$(scutil --get LocalHostName)" cp -r hosts/example "hosts/$host" mv "hosts/$host/users/example.nix" "hosts/$host/users/$(whoami).nix" -
Customise
Your name and email in
hosts/<mac>/darwin-configuration.nix, and the apps you want inhosts/<mac>/users/<login>.nix. -
Track the new host
Flakes only see files git knows about.
git add hosts -
Move the installer's shell files aside
The Nix installer edits these, and nix-darwin takes them over but won't overwrite changes it didn't make.
sudo mv /etc/zshrc /etc/zshrc.before-nix-darwin sudo mv /etc/bashrc /etc/bashrc.before-nix-darwin -
Build & switch
The first time, before nix-darwin is installed. Afterwards it's just
nh darwin switch --ask.sudo nix --extra-experimental-features 'nix-command flakes' \ run --inputs-from . 'nix-darwin#darwin-rebuild' -- \ switch --flake ".#$(scutil --get LocalHostName)"
Files already in the way, like an old ~/.zshrc, go to the Trash rather than being overwritten.
Make it yours
Every module ships defaults. For each one, your host decides whether to use them, add to them, or replace them.
# hosts/<mac>/users/<login>.nix
{
# Nothing to write: every module's defaults apply.
# Turn apps on, and that's it.
dotfiles.ghostty.enable = true;
dotfiles.zed.enable = true;
}
# A value replaces that one default; a list is added to.
{
programs.git.settings.pull.rebase = false;
programs.git.ignores = [ "*.log" ];
}
# Drop the module's defaults, keep only what it needs to work.
{ lib, ... }:
{
dotfiles.zsh.defaults = false;
programs.zsh.autosuggestion.enable = true;
# Or replace one whole list.
programs.zsh.setOptions = lib.mkForce [ "AUTO_PUSHD" ];
}
Edit in place
Some config is nicer by hand. Each host has a config/ folder: Starship and the Neovim config live there and are linked into ~/.config, so you edit them without rebuilding. Zed, Herdr and Colima keep their own settings files writable, with yours merged in on every rebuild.
Secrets, two ways
One Mac: KEY=value lines in ~/.config/secrets.env, outside the repo, loaded by every shell. Several Macs: sops-encrypted files in the repo, decrypted at login with each Mac's SSH key.
Every day
Run from any directory.
nh darwin switch --ask- Build, show the package diff, switch on yes
nh darwin switch --update --ask- The same, after updating the flake inputs
nh search ripgrep- Find a package
nh clean all --keep-since 30d- Delete old generations
sudo darwin-rebuild --rollback- Back to the previous generation