-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
<name>
as prefix in types.attrsOf types.submodule
is often unhelpful
#295872
Comments
The pattern that has established itself is to add - attrsOfWith {
elemType = ...;
metaName = ...;
} I'd be in favor of adding something like this :) |
I think we can drop the attrsWith {
elemType = ...;
...
} Not sure about Context: |
Good point on the And oh actually indeed, this would effectively implement this and therefore also solve that problem! I still think it should be called |
"Meta" is ambiguous in that name. I assume you want it to take the proper meaning of meta, and not refer to the
|
Oh yeah. I think |
Describe the bug
Let's take a look at e.g.
systemd.tmpfiles.settings.<name>.<name>.<name>.user
.The line itself is the first thing you get when searching for how to use
systemd.tmpfiles
on search.nixos.org. The problem is, how am I supposed to know what each of these<name>
entries means?Sure, you can deduce it by looking at the example from
options.systemd.tmpfiles.settings
, but it would be immediately obvious if it's called like this:systemd.tmpfiles.settings.<rule-name>.<type>.<path>
(
type
&path
are derived fromtmpfiles.d(5)
).One ad-hoc way of solving that is to add some kind of
namedAttrsOf
function that accepts an argument for the prefix forgetSubOptions
, however it feels wrong to add a new "type" just for that. Also,namedAttrsOf str
doesn't make much sense, it's effectively the same asattrsOf str
.But perhaps the sub-type can provide a "prefix name" to the parent? Like
attrsOf (submodule { options = ...; name = ...; })
? We should probably force it to be in<
/>
forlib.showOption
. Anyways, I know the knobs where to change that, but we should discuss first whether we want this and I'd need some input on how to reasonably design that.Notify maintainers
@roberth
@infinisil
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: