23 lines
418 B
Nix
23 lines
418 B
Nix
{ lib }:
|
|
let
|
|
collectNixFiles =
|
|
dir:
|
|
lib.flatten (
|
|
lib.mapAttrsToList (
|
|
name: type:
|
|
let
|
|
path = dir + "/${name}";
|
|
in
|
|
if type == "directory" then
|
|
collectNixFiles path
|
|
else if type == "regular" && lib.hasSuffix ".nix" name then
|
|
[ path ]
|
|
else
|
|
[ ]
|
|
) (builtins.readDir dir)
|
|
);
|
|
in
|
|
{
|
|
inherit collectNixFiles;
|
|
}
|