Declarative macOS configuration using nix-darwin, home-manager, and flakes.
- Install Nix:
curl -fsSL https://install.determinate.systems/nix | sh -s -- install - Install Homebrew (for GUI applications):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
First time on a new machine:
# 1. Test the build first
nix run nix-darwin -- build --flake .#$(hostname | cut -d. -f1)
# 2. If build succeeds, apply the configuration
sudo nix run nix-darwin -- switch --flake .#$(hostname | cut -d. -f1)
# 3. Set up git hooks
make init
# 4. Restart shell
exec zshAfter initial setup (regular usage):
sudo make switch # Apply configuration changes
make build # Test without applying
make update # Update flake inputs
make check # Validate flake
make fmt # Format nix filesCLI tools: Add to modules/common.nix
GUI apps: Add to modules/darwin.nix under homebrew.casks
Language toolchains: Use per-project nix dev shells instead of global installs.
Git signing fails: Ensure 1Password is running with SSH agent enabled
Homebrew not found: Restart terminal after initial activation
Changes not applying: Some preferences require logout/restart