LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

nix-channel

manages Nix channel subscriptions

TLDR

List subscribed channels
$ nix-channel --list
copy
Add a channel
$ nix-channel --add [https://nixos.org/channels/nixpkgs-unstable] [nixpkgs]
copy
Update all channels
$ nix-channel --update
copy
Update a specific channel
$ nix-channel --update [nixpkgs]
copy
Remove a channel
$ nix-channel --remove [nixpkgs]
copy
Rollback to a previous channel generation
$ nix-channel --rollback
copy
List channel generations
$ nix-channel --list-generations
copy

SYNOPSIS

nix-channel [options]

DESCRIPTION

nix-channel manages Nix channel subscriptions. Channels are URLs that point to a Nix expression tarball providing a set of packages and NixOS modules.The list of subscribed channels is stored in `~/.nix-channels`. After updating, channel expressions are symlinked from `~/.nix-defexpr/` and become available to `nix-env` and other Nix tools. Nix flakes are the modern alternative to channels.

PARAMETERS

--list

Print names and URLs of all subscribed channels.
--add URL [NAME]
Subscribe to a channel. If NAME is omitted, defaults to the last component of the URL with -stable or -unstable suffixes removed.
--update [NAMES...]
Download Nix expressions of subscribed channels and make them the default for nix-env operations. Optionally update only the named channels.
--remove NAME
Unsubscribe from a channel.
--rollback [GENERATION]
Revert the previous call to `--update`. Optionally specify a generation number.
--list-generations
Show channel generations.
--help
Display help information.
--version
Display version information.

CAVEATS

Channels are a legacy approach; Nix flakes are recommended for new projects. Channels are per-user unless configured system-wide on NixOS. Running `--update` requires network access to download channel expressions.

HISTORY

nix-channel has been part of the Nix package manager since its early releases by Eelco Dolstra. It is the traditional mechanism for subscribing to package repositories, predating the flakes system introduced experimentally in Nix 2.4.

SEE ALSO

Copied to clipboard
Kai