lib/tests: More functionTo tests

This commit is contained in:
Silvan Mosberger
2021-01-26 22:30:07 +01:00
parent e9101d4a3b
commit c2f3556dc7
7 changed files with 117 additions and 31 deletions

View File

@@ -0,0 +1,24 @@
{ lib, config, ... }:
let
inherit (lib) types;
in {
options = {
fun = lib.mkOption {
type = types.functionTo (types.listOf types.str);
};
result = lib.mkOption {
type = types.str;
default = toString (config.fun {
a = "a";
b = "b";
c = "c";
});
};
};
config.fun = lib.mkMerge [
(input: [ input.a ])
(input: [ input.b ])
];
}