refactor homeModules

This commit is contained in:
Romain Paquet 2026-01-27 14:36:11 +01:00
parent 0603a85579
commit 4a870d4a18
26 changed files with 126 additions and 65 deletions

View file

@ -0,0 +1,27 @@
{ lib, ... }:
{
flake.homeModules =
(builtins.readDir ./.)
|> lib.filterAttrs (
path: type:
(type == "directory" && lib.filesystem.pathIsRegularFile (./${path}/default.nix))
|| (type == "regular" && (lib.hasSuffix ".nix" path))
)
|> lib.mapAttrs' (
path: type:
if type == "directory" then
{
name = path;
value = {
imports = [ ./${path} ];
};
}
else
{
name = lib.removeSuffix ".nix" path;
value = {
imports = [ ./${path} ];
};
}
);
}