mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
7 lines
303 B
Nix
7 lines
303 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))
|