summary refs log tree commit diff
path: root/lib/options.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/options.nix')
-rw-r--r--lib/options.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/options.nix b/lib/options.nix
index bb72ad6d125..6e8e9ce0006 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -53,8 +53,8 @@ rec {
     if length list == 1 then head list
     else if all isFunction list then x: mergeDefaultOption loc (map (f: f x) list)
     else if all isList list then concatLists list
-    else if all isAttrs list then fold lib.mergeAttrs {} list
-    else if all isBool list then fold lib.or false list
+    else if all isAttrs list then foldl' lib.mergeAttrs {} list
+    else if all isBool list then foldl' lib.or false list
     else if all isString list then lib.concatStrings list
     else if all isInt list && all (x: x == head list) list then head list
     else throw "Cannot merge definitions of `${showOption loc}' given in ${showFiles (getFiles defs)}.";
@@ -68,7 +68,7 @@ rec {
   /* "Merge" option definitions by checking that they all have the same value. */
   mergeEqualOption = loc: defs:
     if defs == [] then abort "This case should never happen."
-    else fold (def: val:
+    else foldl' (val: def:
       if def.value != val then
         throw "The option `${showOption loc}' has conflicting definitions, in ${showFiles (getFiles defs)}."
       else