diff options
Diffstat (limited to 'lib/tests/modules/functionTo/merging-attrs.nix')
-rw-r--r-- | lib/tests/modules/functionTo/merging-attrs.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/tests/modules/functionTo/merging-attrs.nix b/lib/tests/modules/functionTo/merging-attrs.nix new file mode 100644 index 00000000000..97c015f928a --- /dev/null +++ b/lib/tests/modules/functionTo/merging-attrs.nix @@ -0,0 +1,27 @@ +{ lib, config, ... }: +let + inherit (lib) types; +in { + options = { + fun = lib.mkOption { + type = types.functionTo (types.attrsOf types.str); + }; + + result = lib.mkOption { + type = types.str; + default = toString (lib.attrValues (config.fun { + a = "a"; + b = "b"; + c = "c"; + })); + }; + }; + + config.fun = lib.mkMerge [ + (input: { inherit (input) a; }) + (input: { inherit (input) b; }) + (input: { + b = lib.mkForce input.c; + }) + ]; +} |