Check out FlakeHub — the best place to discover and publish Nix flakes, from Determinate Systems.

We use a single, first-party analytics cookie to focus our limited time and energy on the most important documentation. Check out our privacy policy .

Channels

Nix's original but no longer recommended system for discovering and depending on Nix expressions

Concepts / Channels

We recommend starting with the Nix quick start and consulting concept docs primarily for clarification. Feel free to click x to the right to disable this notification on all concept docs.

A Nix channel is a mechanism used by the legacy Nix CLI to keep Nixpkgs up to date. In the new Nix CLI, channels have been replaced by flakes.

How do channels work?

A channel is a URL that points to some Nix code, such as https://nixos.org/channels/nixos-unstable. As a convenience, you can also use the URL syntax channel:{name}, which is expanded by Nix to https://nixos.org/channels/{name}.

You can configure Nix to fetch a channel automatically:

Add a channel
nix-channel --add https://nixos.org/channels/nixos-unstable

You can then run this to have Nix fetch all channels that you’ve configured:

Update all channels
nix-channel --update

The Nix code in the channels is unpacked into ~/.nix-defexpr/channels where it can be found by legacy CLI commands such as nix-env.

You can find more information about channels in the Nix manual.

Examples of channels

Channel URLRelease dateDescription
channel:nixos-22.11Initially released in November of 2022 and updated for 6 months afterwardsA stable version of NixOS, released in November of 2022. Security patches and updates will be backported, but no new applications, or breaking changes will be applied
channel:nixos-unstableFrequently updatedA rolling release channel of NixOS, which is updated whenever a set of important packages builds on Hydra. Security updates, new packages, and new modules will frequently appear on your computer, and breaking changes may occur
channel:nixos-unstable-smallSame as nixos-unstable, but even more frequentlyA rolling release channel similar to nixos-unstable but with a smaller set of packages that are tested. This means this channel is updated more frequently, but may have some broken packages on it as well

The problem with nix-channel

The problem with channels is that they do not provide any guarantees about what inputs are actually used in a particular build. A channel URL such as channel:nixos-22.11 can contain different Nix code at different points in time. As such source pinning and rollbacks are much harder with channels.

This means that while Nix is reproducible in theory, in practise inputs to builds can frequently change, and a build may fail because of this. This can cause you to be unable to update your NixOS system, or build a package that previously could be built.

Because of this the use of Nix channels is highly discouraged!


Was this page helpful?