My personal Nix configuration for macOS
- https://github.com/dustinlyons/nixos-config
- https://davi.sh/blog/2024/02/nix-home-manager/
- https://davi.sh/blog/2024/11/nix-vscode/
- https://github.com/davish/nix-on-mac/blob/part-3/flake.nix
This is easier than using the Nix installer directly, as it will make it more convenient for you.
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
sh -s -- installNote: We DONT want to install the Determinate Nix version but the regular Nix, so select no when asked.
nix flake init -t nix-darwinnix run nix-darwin -- switch --flake .It might take a while to complete, as it will populate the cache for all the packages.
Reload your terminal to use the new shell.
sudo darwin-rebuild switch --flake .or use the convenience script:
sudo ./rebuild.shNote: Must use sudo - nix-darwin master requires root for system activation.
nix --extra-experimental-features "nix-command flakes" run nix-darwin#darwin-uninstaller/nix/nix-installer uninstall