summary refs log tree commit diff
path: root/lib/attrsets.nix
diff options
context:
space:
mode:
authorvolth <volth@volth.com>2018-07-05 03:01:13 +0000
committervolth <volth@volth.com>2018-07-05 03:08:00 +0000
commite9a6c7cebb62237a523eba804339df6932803459 (patch)
tree238fdae092751f8708b7897fd52d99eeb5c1c0b5 /lib/attrsets.nix
parent1999d279ecd50e4020ef86cda179f3f86ef168ac (diff)
downloadnixpkgs-e9a6c7cebb62237a523eba804339df6932803459.tar
nixpkgs-e9a6c7cebb62237a523eba804339df6932803459.tar.gz
nixpkgs-e9a6c7cebb62237a523eba804339df6932803459.tar.bz2
nixpkgs-e9a6c7cebb62237a523eba804339df6932803459.tar.lz
nixpkgs-e9a6c7cebb62237a523eba804339df6932803459.tar.xz
nixpkgs-e9a6c7cebb62237a523eba804339df6932803459.tar.zst
nixpkgs-e9a6c7cebb62237a523eba804339df6932803459.zip
lib.concatMap and lib.mapAttrs to be builtins
Diffstat (limited to 'lib/attrsets.nix')
-rw-r--r--lib/attrsets.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix
index 19218cfe8ec..dca39cf79ff 100644
--- a/lib/attrsets.nix
+++ b/lib/attrsets.nix
@@ -195,8 +195,9 @@ rec {
           { x = "foo"; y = "bar"; }
        => { x = "x-foo"; y = "y-bar"; }
   */
-  mapAttrs = f: set:
-    listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set));
+  mapAttrs = builtins.mapAttrs or
+    (f: set:
+      listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)));
 
 
   /* Like `mapAttrs', but allows the name of each attribute to be