nixos-conf/custom/hm/programs/default.nix
2026-02-12 16:11:22 +02:00

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);
}