dotfiles

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

~/.dotfiles
Sample output: adding Colima to my Mac.

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
fzf zoxide eza
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 , cmd to run it
nh
Rebuild with a package diff and a confirm
fonts
JetBrains Mono Nerd Font for the terminal and editor

Opt in

ghostty zed neovim
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
yazi lazygit btop
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.

  1. Install the command line tools

    Homebrew and Neovim's parsers need a compiler.

    xcode-select --install
  2. Install Nix

    sh <(curl -L https://nixos.org/nix/install)
  3. Clone your fork into ~/.dotfiles

    nh and the editable config files expect it there.

    git clone https://github.com/<you>/dotfiles.git ~/.dotfiles && cd ~/.dotfiles
  4. 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"
  5. Customise

    Your name and email in hosts/<mac>/darwin-configuration.nix, and the apps you want in hosts/<mac>/users/<login>.nix.

  6. Track the new host

    Flakes only see files git knows about.

    git add hosts
  7. 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
  8. 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;
}

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

Fork it. Make it yours.