ChannelsIf you want to stay up to date with a set of packages, it’s not
very convenient to manually download the latest set of Nix expressions
for those packages, use nix-pull to register
pre-built binaries (if available), and upgrade using
nix-env. Fortunately, there’s a better way:
Nix channels.A Nix channel is just a URL that points to a place that contains
a set of Nix expressions and a manifest. Using the command nix-channel you
can automatically stay up to date with whatever is available at that
URL.You can “subscribe” to a channel using
nix-channel --add, e.g.,
$ nix-channel --add http://nixos.org/channels/nixpkgs-unstable
subscribes you to a channel that always contains that latest version
of the Nix Packages collection. (Instead of
nixpkgs-unstable you could also subscribe to
nixpkgs-stable, which should have a higher level of
stability, but right now is just outdated.) Subscribing really just
means that the URL is added to the file
~/.nix-channels. Right now there is no command
to “unsubscribe”; you should just edit that file manually
and delete the offending URL.To obtain the latest Nix expressions available in a channel, do
$ nix-channel --update
This downloads the Nix expressions in every channel (downloaded from
url/nixexprs.tar.bz2)
and registers any available pre-built binaries in every channel
(by nix-pulling
url/MANIFEST). It also
makes the union of each channel’s Nix expressions the default for
nix-env operations. Consequently, you can then say
$ nix-env -u '*'
to upgrade all packages in your profile to the latest versions
available in the subscribed channels.