Wroclaw
88f348a2c9
also in unstable: use nixpkgs option to define if unstable nixpkgs expressions should be from nixos or nixpkgs channel (default true, use nixos channel)
20 lines
642 B
Nix
20 lines
642 B
Nix
{config, pkgs, lib, ...}:
|
|
|
|
let
|
|
cfg = config.unstable;
|
|
unstableOverlay = import ../pkgs/overlays/unstable.nix;
|
|
in
|
|
{
|
|
options.unstable = {
|
|
enable = lib.mkEnableOption (lib.mkDoc ''
|
|
use of unstable packages in configuration. You can use `unstablePkgs` in configuration modules
|
|
'') // { default = true; };
|
|
};
|
|
config = {
|
|
_module.args.unstablePkgs = if config.unstable.enable then pkgs.unstable else pkgs;
|
|
nixpkgs.overlays = lib.mkIf cfg.enable [ unstableOverlay ];
|
|
system.extraSystemBuilderCmds = lib.mkIf config.unstable.enable ''
|
|
echo ${pkgs.unstableVersion} > $out/nixos-unstable-version
|
|
'';
|
|
};
|
|
}
|