You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
NixOS implements RFC 42 settings for /etc/nix/nix.conf, but that duplicates the C++ settings code defined here.
Describe the solution you'd like
A subcommand that dumps module options, or a file in $out/share/nix.
This can then be vendored by NixOS, so that all options are documented in the NixOS option search, have sensible merging behavior, etc.
Describe alternatives you've considered
Status quo or remove the options. This would be bad UX, for a lack of search and a lack of merging (for users with a split config, but also for predefined configs, profiles).
I think nix show-config --json currently dumps out a structured JSON object for each Setting consisting of its alias, description, default value and some other information(an important piece of information missing is the type). In theory, it should be possible to parse this result in the NixOS module to generate the option tree(if the type information is provided). That being said, I think eventually moving towards something like a JSON schema would be more robust.
A side note, I was a bit surprised by this behavior from nix show-config. I expected the the --json flag to return a JSON object with keys being the setting names and the values being setting values. The manpage simply says Produce output in JSON format, suitable for consumption by another program. which I think is a bit unclear if this is the intended behavior.
The ingredient that's missing from nix show-config --json is the type info.
Those are non-trivial to represent. They could be represented using JSON schema, as @polykernel suggests, or a representation of a module system type AST. The latter seems easiest to translate into a functioning option type.
Is your feature request related to a problem? Please describe.
NixOS implements RFC 42 settings for
/etc/nix/nix.conf
, but that duplicates the C++ settings code defined here.Describe the solution you'd like
A subcommand that dumps module options, or a file in
$out/share/nix
.This can then be vendored by NixOS, so that all options are documented in the NixOS option search, have sensible merging behavior, etc.
Describe alternatives you've considered
Status quo or remove the options. This would be bad UX, for a lack of search and a lack of merging (for users with a split config, but also for predefined configs, profiles).
Additional context
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: