Nix config for my computer(s). Most of the functionality from https://github.com/craigfurman/ansible-home is ported over, but there will probably be a long tail of unported stuff for some time.
My personal laptop makes use of nix-darwin.
- Install nix: https://nixos.org/download/#nix-install-macos
- Install Homebrew
- Yes, it's odd to install another package manager before even using nix! I use Homebrew to install some GUI apps that either self-update or are not available in nixpkgs.
nix-shell -p git git-crypt
git clone [email protected]:craigfurman/nix-workstations.git ~/.config/nix-darwin
cd ~/.config/nix-darwin
git-crypt unlock <key>
nix run nix-darwin -- switch --flake ~/.config/nix-darwin
- After the first run,
darwin-rebuild
should become available. chsh -s /run/current-system/sw/bin/zsh
- It might be possible to automate this by setting https://daiderd.com/nix-darwin/manual/index.html#opt-users.knownUsers, but I'm a bit paranoid about accidentally deleting my user account.
- Remove unused channels (home-manager ensures that a channel pinned to the
flake's nixpkgs is made available for nix-shell and friends)
nix-channel --remove nixpkgs
sudo nix-channel --remove nixpkgs
nix-channel --list
andsudo nix-channel --list
should both return empty.
- Uninstall the original nix version, now that nix-darwin manages it
- Accomplish this by uninstalling all packages from user and root's default profiles. All packages should be managed by nix-darwin / HM / other flakes.
nix profile list
- For each package,
nix-env --uninstall <package>
- Repeat steps with
sudo
nix doctor
- Enable FileVault