Enabling corectrl on stable?

I’m trying to use corectrl, and initially I simply installed it as a package:

  environment.systemPackages = with pkgs; [

But then I found that I could also enable it like this: programs.corectrl.enable = true;.

However, this seems to only be available on the unstable channel. Is there a way to use this one program from unstable while everything else I use is from the stable channel?


NixOS - NixOS 21.05 manual you can use this if you are using channels

I tried adding that:

  imports =
      # CoreCtrl only exists in the unstable channel, so we import it from there and then enable it later

But this gives and error stating:

error: file 'nixos-unstable/nixpkgs/nixos/modules/hardware/corectrl.nix' was not found in the Nix search path (add it using $NIX_PATH or -I), at /etc/nixos/configuration.nix:14:7

How do I solve that?


Looks like I needed to run

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

The first one was mentioned on the wiki, the --update one was not.