-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
require
-> imports
#1486
Labels
Projects
Comments
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe a custom
require
feature was chosen in order to solve a bootstrapping problem.This custom mechanism is not ideal because it adds to the growing list of "override", "overlay", "module", etc. It'd be better to reuse the module system. I suggest the following bootstrapping
module (mapAttrs (k: v: throw k) (functionArgs module)
lib
should be.lib.evalModules
on the network expressions.A more radical approach, suitable for flakes, is to let the user inject
lib
manually. This would change the flake format to require a call likenixopsConfigurations.default = inputs.nixops.lib.mkNetwork { inherit lib; configuration = /* ... */; }
, which is more robust than step 3 and 4. For non-flakenixops.nix
we'll still want something like step 3 and 4 I think.Pros:
Cons:
Myths:
Note to self:
requires
is not a recent addition; compatibility is needed and can be provided at next to no cost, because the module system still supportsrequires
as a hardly known legacy feature.The text was updated successfully, but these errors were encountered: