diff options
Diffstat (limited to 'nixpkgs/lib/tests/modules/functionTo/merging-list.nix')
-rw-r--r-- | nixpkgs/lib/tests/modules/functionTo/merging-list.nix | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/nixpkgs/lib/tests/modules/functionTo/merging-list.nix b/nixpkgs/lib/tests/modules/functionTo/merging-list.nix new file mode 100644 index 000000000000..15fcd2bdcc42 --- /dev/null +++ b/nixpkgs/lib/tests/modules/functionTo/merging-list.nix @@ -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 ]) + ]; +} |