-
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
Add option for defining flake-parts modules for downstream flakes. #61
Conversation
What about |
Fine by me, defer to project maintainers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming to flakePartsModules
seems like the right thing to do, even if I don't like the longer name. That's something that can be solved with a module system feature later:
FYI let me know once the code looks good and I'll |
I was testing this and I am having some issues. I am not sure my issues come from this or from some other part of flake-parts. If I have a flake (flake-parts-module-provider) that uses
Now this comes with using any I found the work-around to pass in the flake containing the
Then in
I'm quite new to flake-parts so please forgive my ignorance if I have missed some essential information provided in the docs etc. Edit:
|
Another case that I haven't found a work-around is that if you want to dog-food your own The work-around there is import the file directly instead. But would be nice if I could define But perhaps that is asking for too much trouble? |
@terlar This is orthogonal to this PR. The same would happen with the current convention,
This adds an unnecessary indirection and it bloats the specialArgs. I'd import the modules in
We need more "guide" docs. Known problem. You've been forgiven ;)
This fundamentally can't be done from inside the |
@shlevy I find |
@roberth Let's separate a few different questions:
My answer to 1 is definitely yes, there is no benefit to the current way other than no one had done the work, but now I have. My answer to 2 is leaning slightly toward My answer to 3 is yes. In part this is out of a desire for commonality with other flake attributes, there is no fundamental reason why a flake should have just one module and it was surprising to me at least to find a singular here where there are plurals elsewhere. But also I can imagine real uses for it, especially in a world with optional/lazily locked inputs, e.g. My answer to 3a is: Why not leverage the module system, and make it so the singular gets mapped to .default automatically? So if I set |
Taking one piece of the other thread here.
I dislike the verbosity of the end user syntax of accessing the data model, not necessarily this part of the flakes data model. Does that explain the misunderstanding or did I miss some other irony? |
@roberth I'm confused now. Do you basically agree with my 4 answers in the comment above then? |
@roberth Updated according to my thinking in #61 (comment) Note that description for the alias doesn't render in the docs because the dev flake is not up-to-date with the new mddoc stuff. |
@roberth can this move forward? |
The change is not bad, but not without risk. Good
Bad
Status quo: users can already define these attributes themselves Maybe this should be an optional module, to be explicitly imported by flakes that want to expose a flake module? |
@roberth Done |
flake-parts users can always just access |
@roberth Thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small change and a rebase 👍
bad0c3f
to
3c60ce7
Compare
@roberth OK, ready to go! |
Thanks! bors r+ |
Build succeeded: |
No description provided.