First, grant the Terminal.app full disk access!!
Run the following command
xcode-select --install
Install Rosetta with the following command
softwareupdate --install-rosetta
Run the following command for the Determinate Installer
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install macos
Or this for the original one
sh <(curl -L https://nixos.org/nix/install)
After installation, in a new shell, run
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
Use git to download the config
In a new terminal session run the following command
nix-shell -p git --run "git clone https://github.com/ohtohalla/nix.git ~/.config/nix"
nix run nix-darwin --extra-experimental-features "nix-command flakes" -- switch --flake ~/.config/nix#home-macbook-pro
If installing a work system, use the command
nix run nix-darwin --extra-experimental-features "nix-command flakes" -- switch --flake ~/.config/nix#work-macbook-pro
For some reason the Determinate Installer does not always create the org.nixos.darwin-store.plist
. In such a case, create said file in the path /Library/LaunchDaemons/
. The file contents should be:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>RunAtLoad</key>
<true/>
<key>Label</key>
<string>org.nixos.darwin-store</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/diskutil</string>
<string>mount</string>
<string>-mountPoint</string>
<string>/nix</string>
<string><UUID OF THE NIX STORE VOLUME></string>
</array>
</dict>
</plist>