changed imports to mkModules

This commit is contained in:
Bryan Ramos 2024-11-07 15:41:50 -05:00
parent 649d9e83b6
commit 5c3d410aa0
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
34 changed files with 67 additions and 448 deletions

View file

@ -0,0 +1,26 @@
with builtins;
let
extractName = string:
let
metadata = [
"pub" "public" "priv" "private"
"key" "file" "." "_" "-" "pk"
];
in
replaceStrings metadata (builtins.map (_: "") metadata) string;
constructKeys = dir: (
listToAttrs (
map (subdir: {
name = subdir;
value = listToAttrs (
map (file: {
name = extractName file;
value = readFile "${dir}/${subdir}/${file}";
}) (filter (node: (readDir "${dir}/${subdir}").${node} == "regular") (attrNames (readDir "${dir}/${subdir}")))
);
}) (filter (node: (readDir dir).${node} == "directory") (attrNames (readDir dir)))
)
);
in
constructKeys ./.