diff options
Diffstat (limited to 'lib/attrsets.nix')
-rw-r--r-- | lib/attrsets.nix | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix index 40bc1667b85..7c93d8698de 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -29,9 +29,8 @@ rec { ["x" "y"] applied with some value v returns `x.y = v;' */ setAttrByPath = attrPath: value: if attrPath == [] then value - else listToAttrs [( - nameValuePair (head attrPath) (setAttrByPath (tail attrPath) value) - )]; + else listToAttrs + [ { name = head attrPath; value = setAttrByPath (tail attrPath) value; } ]; getAttrFromPath = attrPath: set: @@ -133,7 +132,7 @@ rec { => { x = "x-foo"; y = "y-bar"; } */ mapAttrs = f: set: - listToAttrs (map (attr: nameValuePair attr (f attr (getAttr attr set))) (attrNames set)); + listToAttrs (map (attr: { name = attr; value = f attr (getAttr attr set); }) (attrNames set)); /* Like `mapAttrs', but allows the name of each attribute to be |