mirror of
https://git.sr.ht/~goorzhel/turboprop
synced 2024-12-15 17:50:52 +00:00
22 lines
534 B
Nix
22 lines
534 B
Nix
let
|
|
ls = dir: with builtins; attrNames (readDir dir);
|
|
|
|
mkNamespace = (import ./resources.nix).mkNamespace;
|
|
in {
|
|
namespaces = {
|
|
roots,
|
|
extraMetadata ? {},
|
|
}:
|
|
with builtins;
|
|
map
|
|
(name: let
|
|
metadata =
|
|
# Can't use `set?name` or `set.name`
|
|
# because "name" is taken literally.
|
|
if hasAttr name extraMetadata
|
|
then getAttr name extraMetadata
|
|
else extraMetadata.DEFAULT;
|
|
in
|
|
mkNamespace name metadata)
|
|
(concatLists (map ls roots));
|
|
}
|