aboutsummaryrefslogtreecommitdiff
path: root/src/nix/installables.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-01-25 19:03:13 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-01-25 19:03:13 +0100
commit36c4d6f59247826dde32ad2e6b5a9471a9a1c911 (patch)
treec07928e4554aaf6622cd1df996fd4fdc1c368f20 /src/nix/installables.cc
parent807d963ee8d23e88f09e28365b045d322530c5aa (diff)
Group common options
Diffstat (limited to 'src/nix/installables.cc')
-rw-r--r--src/nix/installables.cc13
1 files changed, 13 insertions, 0 deletions
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},
});
}