Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested modules #51

Open
IogaMaster opened this issue Dec 31, 2024 · 1 comment
Open

Nested modules #51

IogaMaster opened this issue Dec 31, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@IogaMaster
Copy link

IogaMaster commented Dec 31, 2024

Is your feature request related to a problem? Please describe.

I would like to have modules nested like so:
modules/foo/bar/baz/
and
modules/foo/qux/baz/

and allow both to work

Describe the solution you'd like

Snowfall lib exports the modules under a string
outputs.nixosModules."modules/foo/bar/baz/"
outputs.nixosModules."modules/foo/qux/baz/"

This allows the simple use like:
myproject.foo.bar.baz.enable =true;
myproject.foo.qux.baz.enable =true;

Describe alternatives you've considered

Additional context

@IogaMaster IogaMaster added the enhancement New feature or request label Dec 31, 2024
@JumpIn-Git
Copy link

JumpIn-Git commented Jan 20, 2025

I have a proposal for this:

modules/nixos/module.nix maps to inputs.self.nixosModules.module.nix, while modules/nixos/desktops/gnome.nix maps to inputs.nixosModules.desktop.gnome (and maybe, if a subdirectory exists with only default.nix, for example modules/nixos/gnome/default.nix it will just map to inputs.self.nixosModules.gnome)

Also, I i think that instead of using inputs.self.<type>.<module>, <type>.<module> would be better; For example:

{homeModules}: {imports = [homeModules.module homeModules.desktop.gnome];}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants