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
"Option definition" is confusing #185234
Comments
Just to make clear, do you suggest to rename (option) definition to (option) value? |
I'm not 100% sure if that's the right thing to do, because right now we have that merging is Here's a start for a new vocabulary, including relevant preexisting definitions. New definitions (as in defining the terminology):
Preexisting (or more obvious?) definitions:
Known flaws:
Alternatives: Use "config" for all "value-level as opposed to type-level-ish" roles:
Any other ideas? |
TBH this all looks very confusing. I understand why you did it that way, and I still think it's cursed by knowledge of PLT and implementation details. What about just saying: option -> option, definition -> configuration? Then you can define (or better: declare) an option, and define a configuration. |
I intend for us to make a choice what it will be, not to preserve all possibilities here. (will edit)
This seems to be a side effect of coming up with accurate definitions. I don't see how we can judge the quality of the terminology without diving into all the intricacies. Without doing this, we won't know if we're creating more ambiguities by our renames. The goal is for the new vocabulary to be more understandable without reading the definitions. The definitions themselves will not be a showcase of how intuitive the new terminology is. That's not their purpose. Their purpose is to avoid ambiguities and serve as reference documentation for the module system itself later.
I'm inclined to use the full word configuration for the "sum of all modules" as represented by the example of
For the purpose of discussing ideas, we can "just say" some renames, but for the purpose of evaluating vocabulary, we need to define them accurately. How would you call the concept I called "config value wrapper" based on your suggestion? Would that be a "configuration wrapper"? To me that seems worse because of the ambiguity with configuration as "sum of all modules", although I admit that discriminating meaning based on whether the word is abbreviated is not really sufficient either. I hope we can do better. I'll ask nbp as well. |
The current naming comes C++ which states that you Old modules still have a few remnant mentions of it: |
We could call this the instance.
Not sure how intuitive that is though, and I don't think we'll stop using "configuration" for the modules that constitute a NixOS instance. |
@roberth Yeah, sorry for being barely constructive there. You're absolutely right that we need to first define the things we talk about, and I think you did a great job carving out the concepts in question. Thank you for taking the time! I know this is painstaking work. Carefully worked through your proposal again, and it fully makes sense to me now. Minor nits, hopefully helpful input:
On using abbreviations: I think we should completely avoid them in reference prose, and always write "configuration", while using code tokens such as |
I suppose half of my gripe is the proximity of meaning in natural language. The other half is: suppose I were to ask you: Define Would you say "whether or not the system should run a PostgreSQL database" or
💯 I guess though in shorthand notation the whole module attrset is a config section. There's a lot not to like about shorthand modules though, but they're easily explained without extra terminology.
Usually not, but
Conflicts a bit with
This seems a bit too vague for the purpose of explaining module system features like
Spot on. |
Reviewing NixOS/nix.dev#725 and giving this thread another read, I came to the conclusion that your proposal #185234 (comment) is perfectly workable. At some point when we get to working on a gentle introduction to the module system, we should approach the config/option distinction by starting with accessing option values through |
Reading this, I'm still confused as to what the proposal is for things like "you declare an option like this..." and "you define an option like that". What are the verbs? |
Also, in your top-comment @roberth where you say
I think it would be helpful to say /where/ one should use that term, something like
This would clarify your suggestion without having to read all the dense commentary below :) |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-10-26-documentation-team-meeting-notes-89/34668/1 |
Just some brief notes:
|
Not sure if anyone still needs convincing that the current naming is unintuitive, but anyway, here's an example that has tripped me up since forever: "The option $x is used but not defined". For me, defined in this context means the same as declared, unless I've somehow discovered the specific naming scheme the module system uses, which is highly unlikely. So this is just another data-point in favor of a rename that doesn't use common use terms in a slightly different way. |
OK, so here's my very simple proposal:
The error above would become "The option $x is used but not set". |
Discussed in the documentation team meeting: This needs a PR to the reference docs on the module system, so we have a final state of discussion to iterate on. A first step would move the relevant bits from the NixOS manual, because they are not specific to NixOS at all. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-11-09-documentation-team-meeting-notes-93/35244/1 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Goal of this issue
Discuss terminology, trying to find an accurate vocabulary for the module system with the goal of improving the documentation and hopefully renaming some terms so that we don't have to rely on the words definition and declaration, which are too close in natural language.
Describe the problem
The module system uses two very similar terms to describe very different concepts:
options
config
(anddefault
andexample
).Outside the context of the module system,
definition
is defined by Merriam-Webster as, among similar meanings:The first meaning only applies to
options
, whereas only the second one applies to both.Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Use clear non-overlapping terminology that doesn't stretch the meaning of non-technical words.
I suggest changing the documentation and error messages to use the term "value" or "option value" where possible. This refers in a correct manner to the relation between types and values.
It is unfortunate that options are declared using Nix language values, specifically those returned by
mkOption
. However, the term is seems consistent with theoptions
module argument, which contains representations of options that include avalue
attribute.Though here, the
value
refers to the final, merged value, as opposed to the individual "config values" that constitute the final "option value".Additional context
The module system does not have dedicated user documentation. It has not been exclusively a NixOS component for a long time, and arguably never, by being in
lib
rather than innixos
.Do we have an issue for that?
Closest issue I've found:
Notify maintainers
@fricklerhandwerk @infinisil
The text was updated successfully, but these errors were encountered: