Created
September 25, 2024 03:47
-
-
Save YuMingLiao/4fc2d3e0deb26bf9c77548ddcc9d052c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs }: | |
with builtins; | |
with pkgs; | |
with lib.attrsets; | |
with stdenv; | |
with rec { | |
deepReadDir = path: | |
let | |
attrset = readDir path; | |
go = name: value: | |
if value == "directory" then | |
deepReadDir (path + "/${name}") | |
else | |
path + "/${name}"; | |
in mapAttrs go attrset; | |
freezeFiles = path: freezeFileSet (deepReadDir path); | |
freezeFileSet = attrset: mapAttrsRecursive go attrset; | |
go = _: filepath: "${filepath}"; | |
}; { | |
inherit freezeFiles; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment