Skip to content

lib/plugins: introduce mkMetaModule #2925

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

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

MattSturgeon
Copy link
Member

Cherry-picked from #2884

@MattSturgeon MattSturgeon requested a review from a team January 28, 2025 19:36
@GaetanLepage
Copy link
Member

Just for me to understand, what is the point of using a module here ?
I get that you want to factor out this logic, but couldn't you use a function for that ?

@traxys
Copy link
Member

traxys commented Jan 29, 2025

Just for me to understand, what is the point of using a module here ? I get that you want to factor out this logic, but couldn't you use a function for that ?

I'd say it's to ease the usage, as it's easier to set imports = [ ... ]; than extraConfig = {_: meta = ..... }, as we have imports pretty much everywhere

@MattSturgeon
Copy link
Member Author

Yes, producing a module simplifies both the usage and implementation.

For usage, we can just dump the value into imports, as with any other module.

For implementation, we have full access to all module args. Especially config and options. In this case, that's useful for getting the default-package only when a url is not explicitly supplied.

At the end of the day, we're working with a module system. Using and producing modules will usually be the idiomatic approach.

😁

Copy link
Member

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok makes perfect sense !

@MattSturgeon
Copy link
Member Author

@mergify queue

Copy link
Contributor

mergify bot commented Jan 29, 2025

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 1a5f1b4

Copy link
Contributor

mergify bot commented Jan 29, 2025

This pull request, with head sha 1a5f1b43930807e1faa30c6fba814f8f2cfa3c37, has been successfully merged with fast-forward by Mergify.

This pull request will be automatically closed by GitHub.

As soon as GitHub detects that the sha 1a5f1b43930807e1faa30c6fba814f8f2cfa3c37 is part of the main branch, it will mark this pull request as merged.

It is possible for this pull request to remain open if this detection does not happen, this usually happens when a force-push is done on this branch mkMetaModule, this means GitHub will fail to detect the merge.

@mergify mergify bot merged commit 1a5f1b4 into nix-community:main Jan 29, 2025
4 checks passed
@mergify mergify bot temporarily deployed to github-pages January 29, 2025 17:46 Inactive
@MattSturgeon MattSturgeon deleted the mkMetaModule branch January 29, 2025 17:53
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.

3 participants