5

I know that I can install a package from the unstable channel like this:

{ config, pkgs, ... }:
let
  unstable-pkgs = import <unstable> {};
in
{
  environment.systemPackages = [ unstable-pkgs.chromium ]
}

This shows that import <unstable> {}; stands in for pkgs in my configuration, but what if I want to do the same thing for programs or services?

1

1 Answer 1

0

I'm assuming that you want to use the stable channel for most of your system, but get some specific programs or services from the unstable channel. You can do this by importing the specific modules you need from unstable.

However, if that module also exists in the stable channel, then the two modules will conflict. You can use disabledModules to suppress the existing module from the stable channel.

For example, this is how I load just the plymouth module from the unstable channel:

{ nixpkgs-unstable, ... }:
{
  imports = [
    "${nixpkgs-unstable}/nixos/modules/system/boot/plymouth.nix"
  ];
  disabledModules = [
    "system/boot/plymouth.nix"
  ];
}

This is on a system using Flakes, where nixpkgs-unstable is defined as a Flake input and that input is passed as part of specialArgs when invoking nixosSystem to build the system configuration. However, imports and disabledModules are not Flakes-specific, so you should be able to do the same thing on a non-Flakes system as long as you can provide a path to the module from the unstable channel.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .