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

Rename nixosModules to modules.{nixos,darwin,arion,...} #7377

Closed
roberth opened this issue Dec 1, 2022 · 2 comments
Closed

Rename nixosModules to modules.{nixos,darwin,arion,...} #7377

roberth opened this issue Dec 1, 2022 · 2 comments
Labels
feature Feature request or proposal flakes

Comments

@roberth
Copy link
Member

roberth commented Dec 1, 2022

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

NixOS isn't the only consumer of the module system. nix flake check (which I think is the only command that cares about modules anyway) should embrace this fact and we can exploit this in the flake schema.

Describe the solution you'd like

I propose to add an attribute that covers all module system applications:

nixosModules.* -> modules.nixos.*
darwinModules.* -> modules.nix-darwin.*
flakeModules.* -> modules.flake-parts.*
etc

This way, nix doesn't need to know about which module system applications exist, but can check the types of these values nonetheless, because all of modules.<application>.<moduleName> must be modules.

Describe alternatives you've considered

Other module system applications stay second-class, produce warnings and remain unchecked.

Ignore the pattern and throw everything into lib, which actually still produces a warning anyway #flakelib

Additional context

@roberth roberth added feature Feature request or proposal flakes labels Dec 1, 2022
roberth referenced this issue in DavHau/drv-parts Dec 4, 2022
@bew
Copy link
Contributor

bew commented Dec 4, 2022

Duplicate of #6257 ?
And #6723

@thufschmitt
Copy link
Member

Duplicate of #6257 ? And #6723

Indeed. I'll close this in favour of #6257 to keep the discussion scoped.

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

No branches or pull requests

3 participants