I got used to structuring the modules this way and was wondering if it was a deliberate decision for ez-configs readModules to produce a flat set of modules.
For a directory structure
├── A
│ └── default.nix
├── B.nix
└── C
├── D.nix
├── non-nix-file-ignored.txt
└── E
├── default.nix
├── some-helper-file-ignored.nix
└── F
└── another-helper-file-ignored.nix
the current implementation produces an attrSet like this
{
A = "/path/to/A/default.nix";
B = "/path/to/B.nix";
}
while the recursive implementation proposed in this PR would produce an attrSet like this
{
A = "/path/to/A/default.nix";
B = "/path/to/B.nix";
C = {
D = "/path/to/C/D.nix";
E = "/path/to/C/E/default.nix";
};
}
I intentionally decided not to recursively descend into the directories. The flake outputs are conventionally flat, and I have not seen anyone create things like nixosConfigurations.attrName.systemName
Hey. I was wondering if
readModules
should recurse into subdirectories and produce a nested attrSet of modules?I migrated from a much more convoluted and deprecated framework for organizing the nixos configs to ez-configs and noticed the difference in behavior.
I got used to structuring the modules this way and was wondering if it was a deliberate decision for ez-configs
readModules
to produce a flat set of modules.For a directory structure
the current implementation produces an attrSet like this
while the recursive implementation proposed in this PR would produce an attrSet like this