summaryrefslogtreecommitdiff
path: root/utils/dirfilter.nix
blob: 8472f79cb8136ae2e68dc94838839ade3008cf70 (plain)
1
2
3
4
5
6
7
{ path, suffix ? null, type ? "regular" }:
let lib = import <nixpkgs/lib>; in
map
	(n: path + ("/" + n))
	(builtins.filter (n: suffix == null || (builtins.match ".*\\.${suffix}" n) != null)
	(lib.attrNames
		(lib.filterAttrs (n: v: v == type) (builtins.readDir path))))