2025-01-12 21:54:47 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
self,
|
|
|
|
...
|
|
|
|
}:
|
2024-02-19 06:42:58 +01:00
|
|
|
|
|
|
|
let
|
2024-06-17 07:24:06 +02:00
|
|
|
cfg = config.unstable;
|
2025-01-12 21:54:47 +01:00
|
|
|
unstableOverlay = self.overlays.unstableWithMeta;
|
2024-02-19 06:42:58 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.unstable = {
|
|
|
|
enable = lib.mkEnableOption (lib.mkDoc ''
|
|
|
|
use of unstable packages in configuration. You can use `unstablePkgs` in configuration modules
|
|
|
|
'') // { default = true; };
|
|
|
|
};
|
2024-06-17 07:24:06 +02:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|