-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
imports
preprocessing function
#196584
Comments
A more general solution is to implement some sort of polymorphism feature to Nix's nascent type system. But can Nix get static types already? :-) |
Why not just |
I understand your motivation, but in this case I believe ergonomics beat simplicity. That all said, this issue suggested a wrong solution. @infinisil was right to point out (at NixCon) that this solution is too powerful. It allows the preprocessing function to be abused, making modules harder to understand, because a module system application could add crazy logic to the imports preprocessing function. For this reason, I've created an alternative solution in #197547, which does not allow arbitrary transformations, but rather makes the concept of module "class" ( |
Project description
Modules have many different applications nowadays: NixOS, home-manager, nix-darwin, NixOS tests, (soon) NixOps networks, Arion, and the list goes on.
Each of these benefit from a standardized flake attribute, but this leads to a bit of boilerplate:
This could be automated with an
evalModules
parameter.NixOS
Afterwards: no more wall of text. Non-default modules grab more attention, but may require more knowledge to write if no example is around.
The text was updated successfully, but these errors were encountered: