../𝚂𝚃𝚇
source

Updating nix channels

Published 2020-01-15, last edit 2020-05-03

I’m always forgetting this:

The command nix-channel is used to create aliases which can be referenced in configuration.nix on nixos. The most important alias is nixos, which is used for the default pkgs reference in your config. Channels are neat but I personally am not really a fan because it is state that exists outside of your config. To change the default nix-channel reference:

# nix-channel --list
nixos https://nixos.org/channels/nixos-19.09

# nix-channel --remove nixos
uninstalling 'nixos-19.09.1861.eb65d1dae62'
building '/nix/store/xsk9wjy0dpp7w7d3r3bkzxzaklqdzq6q-user-environment.drv'...
created 0 symlinks in user environment

# nix-channel --add 'https://nixos.org/channels/nixos-19.09' nixos

# nix-channel --list
nixos https://nixos.org/channels/nixos-19.09

# nix-channel --update
nixos https://nixos.org/channels/nixos-19.09

And then updating the nix-channels can be done with:

# nix-channel --update