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-cryptgit clone [email protected]:craigfurman/nix-workstations.git ~/.config/nix-darwincd ~/.config/nix-darwingit-crypt unlock <key>nix run nix-darwin -- switch --flake ~/.config/nix-darwin- After the first run,
darwin-rebuildshould 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 nixpkgssudo nix-channel --remove nixpkgsnix-channel --listandsudo nix-channel --listshould 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