# 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 flakesto~/.config/nix/nix.conf - Copy contents of
home.nixinto~/.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 --updateThen apply them with Home Manager:
home-manager switchRun 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