+9
-10
lib/filesystem.nix
+9
-10
lib/filesystem.nix
···
239
239
```
240
240
*/
241
241
listFilesRecursive =
242
-
dir:
243
-
lib.flatten (
244
-
lib.mapAttrsToList (
245
-
name: type:
246
-
if type == "directory" then
247
-
lib.filesystem.listFilesRecursive (dir + "/${name}")
248
-
else
249
-
dir + "/${name}"
250
-
) (builtins.readDir dir)
251
-
);
242
+
let
243
+
# We only flatten at the very end, as flatten is recursive.
244
+
internalFunc =
245
+
dir:
246
+
(lib.mapAttrsToList (
247
+
name: type: if type == "directory" then internalFunc (dir + "/${name}") else dir + "/${name}"
248
+
) (builtins.readDir dir));
249
+
in
250
+
dir: lib.flatten (internalFunc dir);
252
251
253
252
/**
254
253
Transform a directory tree containing package files suitable for