1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Merge pull request #8931 from fricklerhandwerk/nix3-config-options

do not show configuration override flags for each command
This commit is contained in:
Théophane Hufschmitt 2023-09-22 14:13:51 +02:00 committed by GitHub
commit f89b84919c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View file

@ -70,6 +70,7 @@ let
* [`${command} ${name}`](./${appendName filename name}.md) - ${subcmd.description} * [`${command} ${name}`](./${appendName filename name}.md) - ${subcmd.description}
''; '';
# TODO: move this confusing special case out of here when implementing #8496
maybeDocumentation = optionalString maybeDocumentation = optionalString
(details ? doc) (details ? doc)
(replaceStrings ["@stores@"] [storeDocs] details.doc); (replaceStrings ["@stores@"] [storeDocs] details.doc);
@ -78,6 +79,10 @@ let
# Options # Options
${showOptions details.flags toplevel.flags} ${showOptions details.flags toplevel.flags}
> **Note**
>
> See [`man nix.conf`](@docroot@/command-ref/conf-file.md#command-line-flags) for overriding configuration settings with command line flags.
''; '';
showOptions = options: commonOptions: showOptions = options: commonOptions:
@ -147,7 +152,7 @@ let
To use this store, you need to make sure the corresponding experimental feature, To use this store, you need to make sure the corresponding experimental feature,
[`${experimentalFeature}`](@docroot@/contributing/experimental-features.md#xp-feature-${experimentalFeature}), [`${experimentalFeature}`](@docroot@/contributing/experimental-features.md#xp-feature-${experimentalFeature}),
is enabled. is enabled.
For example, include the following in [`nix.conf`](#): For example, include the following in [`nix.conf`](@docroot@/command-ref/conf-file.md):
``` ```
extra-experimental-features = ${experimentalFeature} extra-experimental-features = ${experimentalFeature}

View file

@ -203,3 +203,7 @@ Most Nix commands accept the following command-line options:
Fix corrupted or missing store paths by redownloading or rebuilding them. Fix corrupted or missing store paths by redownloading or rebuilding them.
Note that this is slow because it requires computing a cryptographic hash of the contents of every path in the closure of the build. Note that this is slow because it requires computing a cryptographic hash of the contents of every path in the closure of the build.
Also note the warning under `nix-store --repair-path`. Also note the warning under `nix-store --repair-path`.
> **Note**
>
> See [`man nix.conf`](@docroot@/command-ref/conf-file.md#command-line-flags) for overriding configuration settings with command line flags.

View file

@ -236,6 +236,7 @@ nlohmann::json Args::toJSON()
for (auto & [name, flag] : longFlags) { for (auto & [name, flag] : longFlags) {
auto j = nlohmann::json::object(); auto j = nlohmann::json::object();
if (hiddenCategories.count(flag->category)) continue;
if (flag->aliases.count(name)) continue; if (flag->aliases.count(name)) continue;
if (flag->shortName) if (flag->shortName)
j["shortName"] = std::string(1, flag->shortName); j["shortName"] = std::string(1, flag->shortName);