Declarative macOS dev environment via Nix + Home Manager.
One command — installs Nix, enables flakes, clones this repo to
~/Developer/dotfiles, and builds + activates the whole environment:
curl -fsSL https://raw.githubusercontent.com/mathcrln/dotfiles/main/scripts/bootstrap.sh | bashThen install the GUI apps (see bottom). That's it.
If Nix, Home Manager, and this repo are already present (i.e. you're migrating,
not starting fresh), skip bootstrap.sh and just activate the config once:
# -b pre-hm backs up any pre-existing files (e.g. an old ~/.zshrc) to *.pre-hm
home-manager switch -b pre-hm --flake ~/Developer/dotfiles#mathcrlnVerify, then delete the *.pre-hm backups once happy. To roll back:
home-manager generations and activate a previous one.
Edit a file in the repo, then apply:
home-manager switch --flake ~/Developer/dotfilesNever edit
~/.zshrcdirectly. Home Manager generates it (a symlink into the nix store) and overwrites it on everyswitch.
| Want to change… | Edit this | Example |
|---|---|---|
| Shell aliases | modules/shell.nix → shellAliases |
gs = "git status"; |
| Shell functions | configs/functions.zsh (inlined verbatim) |
add a new foo() { ... } |
| CLI packages | modules/packages.nix → home.packages |
add jq to the list |
| Tools w/ shell init | modules/tools.nix |
fzf, zoxide, ripgrep, gh |
| Prompt | configs/starship.toml |
edit TOML directly |
| Git config | modules/git.nix |
aliases, user, ignores |
| Env vars / PATH | home.nix → sessionVariables / sessionPath |
EDITOR, PNPM_HOME |
| Editor/app config | configs/ + home.file in home.nix |
zed keymap, VS Code settings |
After any edit: home-manager switch --flake ~/Developer/dotfiles, then open a
new shell. Find a package name with nix search nixpkgs <name>.
To update everything to the latest pinned versions:
nix flake update (in the repo) then home-manager switch ….
flake.nix/flake.lock— pinned nixpkgs + home-manager; the entry the flake buildshome.nix— home-manager config root, imports modulesmodules/— Nix-managed config (packages, programs, settings)configs/— raw config files for tools that want them (TOML, JSON, etc.)scripts/bootstrap.sh— fresh-machine install (one command)
GUI apps (OrbStack, MacWhisper, MonitorControl, 1Password) are installed manually via their own installers — Nix doesn't manage macOS
.appbundles.