aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd
diff options
context:
space:
mode:
authorThéophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>2023-10-31 16:19:05 +0100
committerLunaphied <lunaphied@lunaphied.me>2024-03-25 17:36:24 -0600
commit86881226b0e51c204f07385b7b57743c23e34d44 (patch)
tree737e75ee7cc6ec8932b850ff6f20adfc4e285628 /src/libcmd
parentaa7653608d4d0028bb98af491aec76b2fea7f882 (diff)
Merge pull request #8817 from iFreilicht/flake-update-lock-overhaul
Overhaul `nix flake update` and `nix flake lock` UX (cherry picked from commit 12a0ae73dbb37becefa5a442eb4532ff0de9ce65) Change-Id: Iff3b4f4235ebb1948ec612036b39ab29e4ca22b2
Diffstat (limited to 'src/libcmd')
-rw-r--r--src/libcmd/command.hh6
-rw-r--r--src/libcmd/installables.cc22
2 files changed, 7 insertions, 21 deletions
diff --git a/src/libcmd/command.hh b/src/libcmd/command.hh
index dafc0db3b..120c832ac 100644
--- a/src/libcmd/command.hh
+++ b/src/libcmd/command.hh
@@ -326,6 +326,12 @@ struct MixEnvironment : virtual Args {
void setEnviron();
};
+void completeFlakeInputPath(
+ AddCompletions & completions,
+ ref<EvalState> evalState,
+ const std::vector<FlakeRef> & flakeRefs,
+ std::string_view prefix);
+
void completeFlakeRef(AddCompletions & completions, ref<Store> store, std::string_view prefix);
void completeFlakeRefWithFragment(
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index 8afbbd51a..dca17555a 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -28,7 +28,7 @@
namespace nix {
-static void completeFlakeInputPath(
+void completeFlakeInputPath(
AddCompletions & completions,
ref<EvalState> evalState,
const std::vector<FlakeRef> & flakeRefs,
@@ -47,13 +47,6 @@ 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,
@@ -86,19 +79,6 @@ MixFlakeOptions::MixFlakeOptions()
});
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));
- }},
- .completer = {[&](AddCompletions & completions, size_t, std::string_view prefix) {
- completeFlakeInputPath(completions, getEvalState(), getFlakeRefsForCompletion(), prefix);
- }}
- });
-
- addFlag({
.longName = "override-input",
.description = "Override a specific flake input (e.g. `dwarffs/nixpkgs`). This implies `--no-write-lock-file`.",
.category = category,