about summary refs log tree commit diff
path: root/lib/tests/modules
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2021-10-02 16:37:22 +0200
committerSilvan Mosberger <contact@infinisil.com>2021-10-02 16:37:22 +0200
commit48293bd6b6b791b9af745e9b7b94a6856e279fa0 (patch)
tree0ea4d2706a5503ce6837fcb81d4e841d1b28c403 /lib/tests/modules
parent54e1db21522a61ca771aeafbbd77c4a474e82f8e (diff)
lib/types: Make types.anything merge functions
Previously it would give an error if there were multiple function
definitions.
Diffstat (limited to 'lib/tests/modules')
-rw-r--r--lib/tests/modules/types-anything/functions.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/tests/modules/types-anything/functions.nix b/lib/tests/modules/types-anything/functions.nix
index 0795189139189..21edd4aff9c44 100644
--- a/lib/tests/modules/types-anything/functions.nix
+++ b/lib/tests/modules/types-anything/functions.nix
@@ -1,16 +1,22 @@
-{ lib, ... }: {
+{ lib, config, ... }: {
 
   options.value = lib.mkOption {
     type = lib.types.anything;
   };
 
+  options.applied = lib.mkOption {
+    default = lib.mapAttrs (name: fun: fun null) config.value;
+  };
+
   config = lib.mkMerge [
     {
       value.single-lambda = x: x;
-      value.multiple-lambdas = x: x;
+      value.multiple-lambdas = x: { inherit x; };
+      value.merging-lambdas = x: { inherit x; };
     }
     {
-      value.multiple-lambdas = x: x;
+      value.multiple-lambdas = x: [ x ];
+      value.merging-lambdas = y: { inherit y; };
     }
   ];