summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Malka <julien@malka.sh>2024-08-12 14:00:26 +0200
committerJulien Malka <julien@malka.sh>2024-08-12 14:00:26 +0200
commitfd38f55c96d633da672027960aa8212a1c6c86e2 (patch)
tree35f86faf40bbb45c99c045c9e41d30f66f0a82d1
parentcnsprcy: init at 0.2.0 (diff)
downloadnixpkgs-origin/fix-function-merge.tar.gz
lib: fix merging of functionsorigin/fix-function-merge
-rw-r--r--lib/options.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/options.nix b/lib/options.nix
index f4d0d9d36cfc..8c9899a58e8c 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -246,7 +246,7 @@ rec {
mergeDefaultOption = loc: defs:
let list = getValues defs; in
if length list == 1 then head list
- else if all isFunction list then x: mergeDefaultOption loc (map (f: f x) list)
+ else if all isFunction list then x: mergeDefaultOption loc (map (def: def // { value = def.value x; }) defs)
else if all isList list then concatLists list
else if all isAttrs list then foldl' lib.mergeAttrs {} list
else if all isBool list then foldl' lib.or false list