From 48293bd6b6b791b9af745e9b7b94a6856e279fa0 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Sat, 2 Oct 2021 16:37:22 +0200 Subject: lib/types: Make types.anything merge functions Previously it would give an error if there were multiple function definitions. --- lib/types.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/types.nix') diff --git a/lib/types.nix b/lib/types.nix index a0be2ff3a45..c2532065d7e 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -192,6 +192,12 @@ rec { else (listOf anything).merge; # This is the type of packages, only accept a single definition stringCoercibleSet = mergeOneOption; + lambda = loc: defs: arg: anything.merge + (loc ++ [ "" ]) + (map (def: { + file = def.file; + value = def.value arg; + }) defs); # Otherwise fall back to only allowing all equal definitions }.${commonType} or mergeEqualOption; in mergeFunction loc defs; -- cgit 1.4.1