about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--read-tree.nix15
1 files changed, 4 insertions, 11 deletions
diff --git a/read-tree.nix b/read-tree.nix
index d883d12c8171..2c53ee1d9b0f 100644
--- a/read-tree.nix
+++ b/read-tree.nix
@@ -3,7 +3,6 @@ path: { pkgs, ... } @ args:
 let
   inherit (builtins)
     attrNames
-    attrValues
     filter
     head
     isString
@@ -11,19 +10,13 @@ let
     map
     match
     readDir
-    tail
     toPath
     toString;
 
-  zipAttrs = names: values:
-    if (names == []) || (values == [])
-    then []
-    else [{
-      name = head names;
-      value = head values;
-    }] ++ zipAttrs (tail names) (tail values);
-
-  attrsToList = attrs: zipAttrs (attrNames attrs) (attrValues attrs);
+  attrsToList = attrs: map (name: {
+    inherit name;
+    value = attrs."${name}";
+  }) (attrNames attrs);
 
   isFile = s: s == "regular";
   isDir = s: s == "directory";