diff --git a/modules/lib/default.nix b/modules/lib/default.nix index b52289ac9..2c7094213 100644 --- a/modules/lib/default.nix +++ b/modules/lib/default.nix @@ -13,7 +13,7 @@ sane-lib = rec { # like `builtins.listToAttrs` but any duplicated `name` throws error on access. # Type: listToDisjointAttrs :: [{ name :: String, value :: Any }] -> AttrSet - listToDisjointAttrs = l: flattenAttrsets (builtins.map nameValueToAttrs l); + listToDisjointAttrs = l: joinAttrsets (builtins.map nameValueToAttrs l); # true if p is a prefix of l (even if p == l) # Type: isPrefixOfList :: [Any] -> [Any] -> bool @@ -21,7 +21,7 @@ sane-lib = rec { # merges N attrsets # Type: flattenAttrsList :: [AttrSet] -> AttrSet - flattenAttrsets = l: lib.foldl' lib.attrsets.unionOfDisjoint {} l; + joinAttrsets = l: lib.foldl' lib.attrsets.unionOfDisjoint {} l; # evaluate a `{ name, value }` pair in the same way that `listToAttrs` does. # Type: nameValueToAttrs :: { name :: String, value :: Any } -> Any diff --git a/modules/lib/merge.nix b/modules/lib/merge.nix index 21ab0945c..761078aac 100644 --- a/modules/lib/merge.nix +++ b/modules/lib/merge.nix @@ -33,7 +33,7 @@ rec { merged = builtins.map (p: lib.setAttrByPath p (mergeAtPath p l)) pathsToMerge; in assert builtins.all (i: assertTakesEveryAttr take i []) l; - sane-lib.flattenAttrsets merged; + sane-lib.joinAttrsets merged; # `take` is as in mkTypedMerge. this function queries which items `take` is interested in. # for example: