-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
nix flake check: Allow modules attribute #10860
base: master
Are you sure you want to change the base?
Conversation
This is intended as a module system "library" in the format <flake>.modules.<class>.<name> where class is e.g. "nixos" or "homeManager", and the name is of the author's choice. Modules that can be loaded in any module system application should use the name "generic". - Implemented in the module system in NixOS/nixpkgs#197547 - Class parameter for checking: https://nixos.org/manual/nixpkgs/stable/index.html#module-system-lib-evalModules-param-class
Not really in favor of this since such a generic attribute would be uncheckable via flake schemas (#8892). So then we may as well provide a flake output attribute named "generic" or "freeform" or something like that. I'm also not convinced that a two-level hierarchy Are there any real-world use cases for modules that can be loaded into any module system? |
Something to consider is that the duplication would make it harder for nix tooling. Now you would need to check both |
@edolstra what is even checkable about modules? Their syntax can be attrsets or functions, and it's only since recently that we can potentially check some modules, if they set
It's a single schema for all module system applications. This allows for more generalized tooling, such as aforementioned frameworks, a library that makes
This is only relevant for
There's also interest in having generic modules for external reuse
The very good reason that justifies it is that it allows modules for all module system applications to be checked with the same code and no per-application boilerplate. We could deprecate all
No, but I don't think it's all that relevant. Nonetheless, #6257 is a 3rd percentile 👍 issue. |
Motivation
Do not warn about another known community attribute, which solves the problem for potentially all "modules" attributes.
Contrext
This is intended as a module system "library" in the format
where class is e.g. "nixos" or "homeManager", and the name is of the author's choice.
Modules that can be loaded in any module system application should use the name "generic".
Implemented in the module system in module system: Improve error messages around faulty imports nixpkgs#197547
Class parameter for checking: https://nixos.org/manual/nixpkgs/stable/index.html#module-system-lib-evalModules-param-class
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.