nixos-configuration/nix-os/unstable-packages.nix
Wroclaw 88f348a2c9 pkgs/overlays: create, move unstable there
also in unstable: use nixpkgs option to define
if unstable nixpkgs expressions should be from
nixos or nixpkgs channel
(default true, use nixos channel)
2024-06-17 07:35:24 +02:00

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
'';
};
}