Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Jan 25, 2025
1 parent 5df6c84 commit 7285f8d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/file/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ rec {
filteredEntries = filterAttrs (name: kind: kind == "regular") entries;
in
mapAttrsToList (name: kind: "${path}/${name}") filteredEntries;
get-files-recursive =
path:
let
entries = safeReadDirectory path;
filtered-entries = filterAttrs (name: kind: (kind == "file") || (kind == "directory")) entries;
map-file =
name: kind:
let
path' = "${path}/${name}";
in
if kind == "directory" then get-files-recursive path' else path';
files = lib.flatten (mapAttrsToList map-file filtered-entries);
in
files;

getFilesRecursive =
path:
Expand Down

0 comments on commit 7285f8d

Please sign in to comment.