-
Notifications
You must be signed in to change notification settings - Fork 44
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
No access to flake inputs within a perSystem module #101
Comments
The idea behind this restriction is to make sure that all flake-parts modules are in one, compatible form.
This should work if you define the module as a top-level module. The top-level module provides the lexical scope with these variables, as suggested in the error message. |
This decision could be reverted when we have
|
I think the top-level module should always be a flake module, then it can define nested
When defining a nested |
I just had the same issue, I wanted to access my util flake from a perSystem module. A workaround is adding this to the ({...}: {
_module.args.origInputs = inputs;
}) I could then just use |
Similar to #81.
Trying to add
inputs
to theperSystem
args, triggers this error:The statements about the scope only hold true as long as all code is defined inside a single
flake.nix
file.The lexical scope breaks as soon as the code is split into modules.
For example given the following flake.nix:
and
my-package.nix
:This breaks because
inputs
is not allowed as a function argument. This means it is not possible to access some inputslib
or similar things inside a perSystem module.The text was updated successfully, but these errors were encountered: