mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-10 04:49:19 -08:00
5 lines
301 B
Nix
5 lines
301 B
Nix
{ lib }: path: excludes: let
|
|
filterAttrNamesToList = filter: set:
|
|
lib.foldl' (a: b: a ++ b) [ ]
|
|
(map (e: if (filter e set.${e}) then [ e ] else [ ]) (lib.attrNames set));
|
|
in (filterAttrNamesToList (name: type: ! (builtins.elem name excludes) && type == "directory") (builtins.readDir path))
|