My macOS setup with nix and Homebrew, managed by nix-darwin
My macOS setup with nix and Homebrew, managed by nix-darwin.
On a fresh Mac, some setup is required before we can use nix-darwin
:
Install nix
itself, as per the nix installation docs:
curl -L https://nixos.org/nix/install | sh
Install brew
(so we can manage GUI applications with nix-darwin), as per the brew.sh instructions:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install Rosetta if necessary:
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
Create the /run
symlink that the nix-darwin
installer would usually set up:
printf 'run\tprivate/var/run\n' | sudo tee -a /etc/synthetic.conf
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t
Build our flake:
nix --experimental-features "nix-command flakes" \
build github:dxmh/system-config#darwinConfigurations.setze.system
Now we can run nix-darwin
for the first time:
./result/sw/bin/darwin-rebuild switch \
--flake github:dxmh/system-config#setze