This repository contains my Apple Silicon macOS configuration. It lives at ~/.config/nix and builds the dcmbp nix-darwin host together with the danielcorin Home Manager profile.
Build first so evaluation and package failures happen before privileged activation:
darwin-rebuild build --flake .#dcmbp
sudo darwin-rebuild switch --flake .#dcmbpHome Manager is imported as a nix-darwin module and is rebuilt with the system. It does not require a separate channel or home-manager switch installation (Home Manager nix-darwin documentation).
The flake exposes nixfmt-tree as its formatter. Its checks build the complete dcmbp system closure and run deadnix and statix lints:
nix fmt
nix flake checknixfmt is the official Nix formatter (nixfmt documentation). nix flake check evaluates and builds derivations exposed through checks (Nix command reference).
flake.nixwires pinned inputs, thedcmbphost, Home Manager, formatting, and checks.hosts/dcmbpcontains host identity and compatibility settings.modules/darwincontains Homebrew, Nix daemon, and macOS system settings.homecontains the user profile and program-specific configuration.home/palette.nixholds the Monokai colors shared by Ghostty and ccstatusline.
flake.lockis committed so evaluations resolve the same input revisions (Nix flakes documentation). nix-darwin and Home Manager both follow the same Nixpkgs input.system.stateVersion = 5andhome.stateVersion = "23.11"preserve compatibility with the releases that initialized the machine. They should not be raised merely because inputs are newer (Home Manager upgrade guide).- The host targets
aarch64-darwinonly. No Intelextra-platformscompatibility is enabled. - Nix builds use sandboxing, automatic job/core selection, and a
trusted-userslist containing onlyroot. Nix warns that daemon trust is effectively root access (Nix configuration reference, sandbox setting). - Garbage collection runs weekly and retains generations for 30 days; store optimization runs automatically. Explicit
Weekdayscheduling avoids launchd's calendar-day semantics (Apple launchd scheduling documentation, Nix garbage-collection manual). - Homebrew activation does not update or upgrade packages implicitly.
cleanup = "uninstall"converges installed packages without the application-data deletion performed byzap(nix-darwin Homebrew options, Homebrew Bundle documentation). - Home Manager owns most command-line tools and their configuration. Homebrew owns macOS app bundles, system integrations, and selected formulae. WezTerm's app comes from Homebrew while Home Manager owns its configuration.
- Homebrew installs
miseto avoid building it from source through Nix; zsh activates it directly. The official mise guide documents Homebrew as a supported alternative installation (mise installation guide). - The macOS application firewall and stealth mode are enabled, and automatic macOS updates are allowed (Apple firewall guide, Apple update guide). FileVault and its recovery key remain outside version control (Apple FileVault guide).
I use GitHub Code Search to learn from configurations people have generously open-sourced. Helpful resources include:
- Nixcademy: Nix on macOS
- David Teather: Nix macOS setup
- mhanberg dotfiles
- bphenriques fzf configuration
- Native fix for apps under the MacBook Pro notch
- maxbrunet dotfiles
- malob nixpkgs configuration
- milogert tmux configuration
- Josean Martinez: SketchyBar setup
- Martin Heinz: managing dotfiles with Nix
- davish setup