aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/command.cc9
-rw-r--r--src/nix/command.hh2
-rw-r--r--src/nix/installables.cc13
-rw-r--r--src/nix/main.cc1
-rw-r--r--src/nix/sigs.cc6
5 files changed, 27 insertions, 4 deletions
diff --git a/src/nix/command.cc b/src/nix/command.cc
index 20eeefe91..614dee788 100644
--- a/src/nix/command.cc
+++ b/src/nix/command.cc
@@ -61,6 +61,7 @@ StorePathsCommand::StorePathsCommand(bool recursive)
addFlag({
.longName = "no-recursive",
.description = "Apply operation to specified paths only.",
+ .category = installablesCategory,
.handler = {&this->recursive, false},
});
else
@@ -68,10 +69,16 @@ StorePathsCommand::StorePathsCommand(bool recursive)
.longName = "recursive",
.shortName = 'r',
.description = "Apply operation to closure of the specified paths.",
+ .category = installablesCategory,
.handler = {&this->recursive, true},
});
- mkFlag(0, "all", "Apply the operation to every store path.", &all);
+ addFlag({
+ .longName = "all",
+ .description = "Apply the operation to every store path.",
+ .category = installablesCategory,
+ .handler = {&all, true},
+ });
}
void StorePathsCommand::run(ref<Store> store)
diff --git a/src/nix/command.hh b/src/nix/command.hh
index 791dd0f1e..ed6980075 100644
--- a/src/nix/command.hh
+++ b/src/nix/command.hh
@@ -23,6 +23,8 @@ static constexpr Command::Category catSecondary = 100;
static constexpr Command::Category catUtility = 101;
static constexpr Command::Category catNixInstallation = 102;
+static constexpr auto installablesCategory = "Options that change the interpretation of installables";
+
struct NixMultiCommand : virtual MultiCommand, virtual Command
{
nlohmann::json toJSON() override;
diff --git a/src/nix/installables.cc b/src/nix/installables.cc
index 34ee238bf..4e6bf4a9a 100644
--- a/src/nix/installables.cc
+++ b/src/nix/installables.cc
@@ -58,39 +58,47 @@ void completeFlakeInputPath(
MixFlakeOptions::MixFlakeOptions()
{
+ auto category = "Common flake-related options";
+
addFlag({
.longName = "recreate-lock-file",
.description = "Recreate the flake's lock file from scratch.",
+ .category = category,
.handler = {&lockFlags.recreateLockFile, true}
});
addFlag({
.longName = "no-update-lock-file",
.description = "Do not allow any updates to the flake's lock file.",
+ .category = category,
.handler = {&lockFlags.updateLockFile, false}
});
addFlag({
.longName = "no-write-lock-file",
.description = "Do not write the flake's newly generated lock file.",
+ .category = category,
.handler = {&lockFlags.writeLockFile, false}
});
addFlag({
.longName = "no-registries",
.description = "Don't allow lookups in the flake registries.",
+ .category = category,
.handler = {&lockFlags.useRegistries, false}
});
addFlag({
.longName = "commit-lock-file",
.description = "Commit changes to the flake's lock file.",
+ .category = category,
.handler = {&lockFlags.commitLockFile, true}
});
addFlag({
.longName = "update-input",
.description = "Update a specific flake input (ignoring its previous entry in the lock file).",
+ .category = category,
.labels = {"input-path"},
.handler = {[&](std::string s) {
lockFlags.inputUpdates.insert(flake::parseInputPath(s));
@@ -104,6 +112,7 @@ MixFlakeOptions::MixFlakeOptions()
addFlag({
.longName = "override-input",
.description = "Override a specific flake input (e.g. `dwarffs/nixpkgs`).",
+ .category = category,
.labels = {"input-path", "flake-url"},
.handler = {[&](std::string inputPath, std::string flakeRef) {
lockFlags.inputOverrides.insert_or_assign(
@@ -115,6 +124,7 @@ MixFlakeOptions::MixFlakeOptions()
addFlag({
.longName = "inputs-from",
.description = "Use the inputs of the specified flake as registry entries.",
+ .category = category,
.labels = {"flake-url"},
.handler = {[&](std::string flakeRef) {
auto evalState = getEvalState();
@@ -144,6 +154,7 @@ SourceExprCommand::SourceExprCommand()
.longName = "file",
.shortName = 'f',
.description = "Interpret installables as attribute paths relative to the Nix expression stored in *file*.",
+ .category = installablesCategory,
.labels = {"file"},
.handler = {&file},
.completer = completePath
@@ -152,6 +163,7 @@ SourceExprCommand::SourceExprCommand()
addFlag({
.longName = "expr",
.description = "Interpret installables as attribute paths relative to the Nix expression *expr*.",
+ .category = installablesCategory,
.labels = {"expr"},
.handler = {&expr}
});
@@ -159,6 +171,7 @@ SourceExprCommand::SourceExprCommand()
addFlag({
.longName = "derivation",
.description = "Operate on the store derivation rather than its outputs.",
+ .category = installablesCategory,
.handler = {&operateOn, OperateOn::Derivation},
});
}
diff --git a/src/nix/main.cc b/src/nix/main.cc
index 77a13c913..58b643cc5 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -80,6 +80,7 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
.longName = "print-build-logs",
.shortName = 'L',
.description = "Print full build logs on standard error.",
+ .category = loggingCategory,
.handler = {[&]() {setLogFormat(LogFormat::barWithLogs); }},
});
diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc
index 3445182f2..c64b472b6 100644
--- a/src/nix/sigs.cc
+++ b/src/nix/sigs.cc
@@ -16,7 +16,7 @@ struct CmdCopySigs : StorePathsCommand
addFlag({
.longName = "substituter",
.shortName = 's',
- .description = "Use signatures from specified store.",
+ .description = "Copy signatures from the specified store.",
.labels = {"store-uri"},
.handler = {[&](std::string s) { substituterUris.push_back(s); }},
});
@@ -24,7 +24,7 @@ struct CmdCopySigs : StorePathsCommand
std::string description() override
{
- return "copy path signatures from substituters (like binary caches)";
+ return "copy store path signatures from substituters";
}
void run(ref<Store> store, StorePaths storePaths) override
@@ -110,7 +110,7 @@ struct CmdSign : StorePathsCommand
std::string description() override
{
- return "sign the specified paths";
+ return "sign store paths";
}
void run(ref<Store> store, StorePaths storePaths) override