Install Determinate Nix using nix-installer:
curl -fsSL https://install.determinate.systems/nix | sh -s -- install --determinate --diagnostic-endpoint=""Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Bootstrap nix-darwin:
nix build .#darwinConfigurations.$(hostname).system
# Create a symlink from /run to /private/var/run required by nix-darwin. This step is needed since macOS does not allow any software to write to the root directory.
printf 'run\tprivate/var/run\n' | sudo tee -a /etc/synthetic.conf
# If the following command fails, restart the OS to achieve the same thing.
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t
sudo ./result/sw/bin/darwin-rebuild switch --flake .If the macOS user was not created by nix-darwin and Can't set user shell without giving nix-darwin complete control over my user issue is still not solved, run:
chsh -s /run/current-system/sw/bin/zshIf infocmp tmux-256color produces an error, run:
ln -s ~/.nix-profile/share/terminfo/74/tmux-256color ~/.terminfo/74/tmux-256colorFrom now on, changes to the configuration can be applied by running:
make switchTo activate configuration changes such as autohiding the dock, log out and log in again.
List home-manager profile versions:
nix profile historySwitch to the previous home-manager profile version:
nix profile rollbackSwitch to version 39 of the home-manager profile:
nix profile rollback --to 39List nix-darwin profile versions:
darwin-rebuild --list-generations
# OR
nix profile history --profile /nix/var/nix/profiles/systemSwitch to the previous nix-darwin profile version:
darwin-rebuild switch --rollbackSwitch to version 30 of the nix-darwin profile:
darwin-rebuild -G 30