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

Draft: feat: use a custom haumea loader #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

korrat
Copy link
Contributor

@korrat korrat commented Mar 15, 2024

This patch replaces the scoped loader used in load with a custom version that can resolve module arguments as well.

@korrat
Copy link
Contributor Author

korrat commented Mar 15, 2024

Once #32 is merged, we can rebase this branch on top of main.

One problem of this patch is that the scoped functionality does not match the function version exactly, due to the way the imports work. I don't believe that will be fixable. Therefore, I left the pkgs argument on the module definition in load. Consumers can then rely on cell, config, inputs, lib, modulesPath, options, and pkgs being in scope, while for all other arguments, they would have to declare a function. Is that a good compromise?

@korrat
Copy link
Contributor Author

korrat commented Mar 15, 2024

We might want to move defaultWith/loader/load/findLoad into individual source files to clean up flake.nix.

@korrat korrat force-pushed the custom-haumea-loader branch 2 times, most recently from 32b53a0 to 3a7d6d4 Compare March 15, 2024 16:47
@korrat
Copy link
Contributor Author

korrat commented Mar 15, 2024

The first commit (apart from the one included in #32) works with https://github.com/Lord-Valen/configuration.nix.

The second commit replaces the custom loader implementation with applyModuleArgsIfFunction, mostly. However, that causes some failures, since now config, lib, and options are always passed. Could be worth it for the reduced maintenance, but would cause some more churn for users. Also, it yields a warning about external calls to the function being deprecated.

This patch replaces the scoped loader used in `load` with a custom
version that can resolve module arguments as well.
@korrat korrat marked this pull request as ready for review August 21, 2024 08:48
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.

1 participant