Chris Stryczynski

Software Developer / Consultant

A quick introduction to Nix packages, channels and Nixos generations

Posted on: 20/02/2020

I remember being incredibly excited to try out Nix. But I initially had a lot of confusion over packages/channels/generations - hence this post!

A channel refers to a git branch in this repo:

Note: all these commands could be user specific, hence if you run them as root / sudo you may get different results.

You can view your existing channels with:

sudo nix-channel --list

You can “pull” the latest commits into your channels with

sudo nix-channel --update

If you create a new generation, it will reference the commits that exist in your local definition of the channel.

sudo nixos-rebuild build


Your regular “user” (or even root!) has a nix environment separate from your Nixos “system” environment (also a nix environment).

To list the generations of your system:

nix-env --list-generations --profile /nix/var/nix/profiles/system

To list the generations of your user:

nix-env --list-generations

No comments, yet!

Submit a comment