mirror of
https://seed.radicle.dev/rad:z254T5p17bdFPmzfDojsdjo4HjpoZ.git
synced 2026-10-18 19:10:32 +08:00
22 lines
418 B
Nix
22 lines
418 B
Nix
{lib}: let
|
|
inherit
|
|
(lib)
|
|
listToAttrs
|
|
attrNames
|
|
replaceStrings
|
|
;
|
|
inherit
|
|
(builtins)
|
|
readDir
|
|
;
|
|
in rec {
|
|
kebabCaseToCamelCase =
|
|
replaceStrings (map (s: "-${s}") lib.lowerChars) lib.upperChars;
|
|
|
|
dirToAttrs = dir:
|
|
listToAttrs (map (name: {
|
|
name = kebabCaseToCamelCase (lib.removeSuffix ".nix" name);
|
|
value = dir + "/${name}";
|
|
}) (attrNames (readDir dir)));
|
|
}
|