M1 macOS (nix-darwin) config, managed with a flake and home-manager.
# Enable flakes if you haven't:
mkdir -p ~/.config/nix
echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf
# First run: bootstraps darwin-rebuild, then applies system + user.
sudo nix run nix-darwin/master#darwin-rebuild -- switch --flake ~/dotfiles#<user>After the first run, re-apply with (aliased to rebuild):
sudo darwin-rebuild switch --flake ~/dotfiles#<user>User-only changes (no sudo):
home-manager switch --flake ~/dotfiles#<user>@mac # aliased to `rebuild-home`sudo nix run nix-darwin#darwin-uninstaller # removes nix-darwinStock files it replaced are backed up next to the originals as
.before-nix-darwin / .hm-bak; restore those if needed, then delete
~/dotfiles.