Personal Apple Silicon Mac setup with nix-darwin and home-manager. One repo, one bootstrap, same machine every time.
Stack: system defaults + Homebrew (via nix-homebrew), daily CLIs via Nix, project runtimes via mise, zsh/starship, Neovim + WezTerm (rose-pine moon), Finder open-in-Code/WezTerm services, and agent configs (Codex, opencode, Grok, Claude Code, Kimi Code, Oh My Pi, optional Pi).
git clone git@github.com:leihuang23/dotfiles.git
cd dotfiles
./bootstrap.sh # Nix → ~/.dotfiles link → username check → first switchAfter that, apply changes with:
./rebuild.shDefaults in this tree: user leihuang, host macbook-pro, aarch64-darwin. Change those (and git name/email in home.nix) before bootstrap on another machine. Host label must match in flake.nix, rebuild.sh, and bootstrap.sh.
Homebrew: homebrew.onActivation.cleanup = "zap" removes undeclared brews/casks on every switch. Read configuration.nix first.
| Path | Role |
|---|---|
flake.nix |
Entry: nixpkgs, nix-darwin, home-manager, nix-homebrew |
configuration.nix |
System + Homebrew |
home.nix |
User packages, shell, git, symlinks |
home/ |
Live configs (nvim, wezterm, agents, mise, skills, …) |
bootstrap.sh / rebuild.sh |
First switch / daily re-apply |
home.nix uses out-of-store symlinks, so edits under home/ are live; run ./rebuild.sh only for package lists and system settings.
Hybrid: Nix owns always-on machine tools; mise owns per-project runtimes. Do not install the same CLI in both. Global mise config: home/.config/mise/config.toml.
- Claude Code: Homebrew cask; provider/env owned by CC Switch (do not fully manage
~/.claude/settings.json). - Docker Desktop: use
install-docker-desktop(not a brew cask here). - High-agency aliases:
co→codex --full-auto,cc→claude --dangerously-skip-permissions. - Optional Pi resources under
home/.pi/agent/; runtime state stays local.
MIT No Attribution. See LICENSE.
Inspired by kunchenguid's work.