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

Ensure module args is set for modules #25

Closed
wants to merge 1 commit into from

Conversation

ratson
Copy link
Contributor

@ratson ratson commented Nov 1, 2024

Fix #22

Run test.sh in https://github.com/ratson/bug-report/tree/flakelight-nixos-module-fixed verified the problem solved.

@accelbread
Copy link
Collaborator

Hmm, I'm not sure doing this by default is a good idea, as it conflates arguments from where the module is defined vs arguments where it is defined. With this, all of the defining flakes's module args are made available to exported modules which may not be desirable. It would mean that adding an arg with a certain name to your own config could affect how args for modules imported from another flake are interpreted. Setting _modules.args also affects all modules; an unrelated module could use those deps, which would fail when the imported module providing them is removed. Also the args could conflict between multiple imported modules.

If moduleArgs from the defining flake are needed in a module, it should be a function that takes moduleArgs and returns a module (thus the module does not have them in its args, but rather closes over them.

@ratson
Copy link
Contributor Author

ratson commented Nov 8, 2024

Fair enough, adding global args from an imported module is not a good idea.

@ratson ratson closed this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inputs in nixosModule is not available for external flake
2 participants