NixOs Snippets

Installing a package from unstable

If the package in the NixOs release you’re using is too old, you can install that single package from unstable instead.

For example I needed access to Hugo v0.112 when NixOs 22.11 only provided v0.106.

Add the unstable channel to your list of subscribed channels:

sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
sudo nix-channel --update

And add to your configuration.nix:

1
2
3
4
5
6
7
8
environment.systemPackages = 
  let
    unstable = import <nixos-unstable> {};
  in 
    with pkgs; [
        unstable.hugo
        # And other packages your system needs.
    ];