Fediversity/keys/default.nix

17 lines
375 B
Nix
Raw Normal View History

let
inherit (builtins)
elemAt
mapAttrs
match
readDir
readFile
;
removeTrailingWhitespace = s: elemAt (match "(.*[^[:space:]])[[:space:]]*" s) 0;
collectKeys =
dir: mapAttrs (name: _: removeTrailingWhitespace (readFile (dir + "/${name}"))) (readDir dir);
in
{
contributors = collectKeys ./contributors;
systems = collectKeys ./systems;
}