My nix configuration.
- Install nix
- Install nix-darwin
In addition to the regular installation steps (which were painful), I had to add darwin as a channel for my user:
nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
nix-channel --update
- Install home-manager
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update
-
Clone this repo into
~/.nixpkgs
-
Run:
darwin-rebuild switch
Mac apps built with Nix don't play well with Alfred / spotlight search. To work around this, we create aliases for nix applications and place them in $HOME/Applications/Nix
. See this issue for more context.
We need to configure Alfred to index aliases by going to Alfred Preferences -> Features -> Default Results -> Extras -> Advanced...
and dragging in one of the aliases in $HOME/Applications/Nix
.
Root owns the nixpkgs channel so sudo is needed to update that:
sudo nix-channel --update
User channels should be updated as well:
nix-channel --update