lib/values: fix submodule and submoduleWith with external modules

This commit is contained in:
Johannes Kirschbauer
2024-12-06 21:01:27 +01:00
parent 4444c4a5c2
commit cd233fbacb
2 changed files with 43 additions and 10 deletions

View File

@@ -130,6 +130,42 @@ in
};
};
test_submoduleWith =
let
evaluated = (
eval [
{
options.foo = lib.mkOption {
type = lib.types.submoduleWith {
modules = [
{
options.bar = lib.mkOption {
type = lib.types.bool;
};
}
];
};
};
}
{
foo.bar = false;
}
]
);
in
{
inherit evaluated;
expr = slib.getPrios {
options = evaluated.options;
};
expected = {
foo = {
__prio = 100;
bar.__prio = 100; # Set via other module
};
};
};
# TODO(@hsjobeki): Cover this edge case
# test_freeform =
# let