23 lines
510 B
Nix
23 lines
510 B
Nix
{ lib, ... }:
|
|
let
|
|
here = ./.;
|
|
entries = builtins.readDir here;
|
|
names = lib.attrNames entries;
|
|
|
|
nixFiles =
|
|
builtins.filter
|
|
(n: entries.${n} == "regular" && lib.hasSuffix ".nix" n && n != "default.nix")
|
|
names;
|
|
|
|
subdirDefaultNix =
|
|
builtins.filter
|
|
(d: entries.${d} == "directory"
|
|
&& builtins.pathExists (here + "/${d}/default.nix"))
|
|
names;
|
|
|
|
in
|
|
{
|
|
imports =
|
|
(map (n: here + "/${n}") nixFiles)
|
|
++ (map (d: here + "/${d}/default.nix") subdirDefaultNix);
|
|
}
|