# Install Nix
sh <(curl -L https://nixos.org/nix/install)
# Follow unstable channel
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
# Update packages store
nix-channel --update
- Install Home Manager (standalone installation):
# Add Home Manager channel
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
# Update packages store
nix-channel --update
# Install Home Manager and create the first generation
nix-shell '<home-manager>' -A install
- Add
extra-experimental-features = nix-command flakes
to~/.config/nix/nix.conf
- Copy contents of
home.nix
into~/.config/home-manager/home.nix
- Run
home-manager switch
- Done
The following commands update your environment to the latest packages:
First, update Nix packages:
nix-channel --update
Then apply them with Home Manager:
home-manager switch
Run this every so often to clear out previous versions of packages. This removes your ability to roll back to a previous generation, so make sure your environment is stable before running it.
nix-collect-garbage -d