When defining an option in an RFC42-style free-form settings module, say settings.foo, the module system always creates a config.settings.foo value containing the default value.
Some configuration formats require that config definitions are omitted in order to get the default behavior. Filtering those out of the config is unpleasant at least and as far as I know we don't have a standard solution for it.
We could add a mkOption argument that has the effect of producing no default value and no config attribute when no definitions are present for the option.
This will allow us to simplify modules that need to elide unset options and it lowers the threshold for defining options within a settings module, improving documentation and merge semantics.
Notify maintainers
@infinisil
Additional context
This idea has come up in #112494 as well, but I'm not convinced that it isn't feasible.
When defining an option in an RFC42-style free-form settings module, say
settings.foo, the module system always creates aconfig.settings.foovalue containing the default value.Some configuration formats require that
configdefinitions are omitted in order to get the default behavior. Filtering those out of theconfigis unpleasant at least and as far as I know we don't have a standard solution for it.We could add a
mkOptionargument that has the effect of producing no default value and noconfigattribute when no definitions are present for the option.This will allow us to simplify modules that need to elide unset options and it lowers the threshold for defining options within a settings module, improving documentation and merge semantics.
Notify maintainers
@infinisil
Additional context
This idea has come up in #112494 as well, but I'm not convinced that it isn't feasible.