forked from DGNum/colmena
eval.nix: Add meta.specialArgs
This commit is contained in:
parent
671cf38796
commit
135a42b20f
2 changed files with 28 additions and 1 deletions
|
@ -72,6 +72,16 @@ let
|
|||
apply = value: if value == null then null else toString value;
|
||||
type = types.nullOr types.path;
|
||||
};
|
||||
specialArgs = lib.mkOption {
|
||||
description = ''
|
||||
A set of special arguments to be passed to NixOS modules.
|
||||
|
||||
This will be merged into the `specialArgs` used to evaluate
|
||||
the NixOS configurations.
|
||||
'';
|
||||
default = {};
|
||||
type = types.attrsOf types.unspecified;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -334,7 +344,7 @@ let
|
|||
hive.defaults
|
||||
config
|
||||
] ++ (import (npkgs.path + "/nixos/modules/module-list.nix"));
|
||||
specialArgs = {
|
||||
specialArgs = hive.meta.specialArgs // {
|
||||
inherit name nodes;
|
||||
modulesPath = npkgs.path + "/nixos/modules";
|
||||
};
|
||||
|
|
|
@ -388,3 +388,20 @@ fn test_nixpkgs_config_override() {
|
|||
vec![ "test".to_string() ]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_meta_special_args() {
|
||||
TempHive::valid(r#"
|
||||
{
|
||||
meta.specialArgs = {
|
||||
undine = "assimilated";
|
||||
};
|
||||
|
||||
borg = { undine, ... }:
|
||||
assert undine == "assimilated";
|
||||
{
|
||||
boot.isContainer = true;
|
||||
};
|
||||
}
|
||||
"#);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue