aboutsummaryrefslogtreecommitdiff
path: root/src/nix/installables.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/installables.cc')
-rw-r--r--src/nix/installables.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/nix/installables.cc b/src/nix/installables.cc
index db67952e1..6d784002a 100644
--- a/src/nix/installables.cc
+++ b/src/nix/installables.cc
@@ -23,9 +23,9 @@ SourceExprCommand::SourceExprCommand()
.dest(&file);
mkFlag()
- .longName("no-update")
- .description("don't create/update flake lock files")
- .set(&updateLockFile, false);
+ .longName("recreate-lock-file")
+ .description("recreate lock file from scratch")
+ .set(&recreateLockFile, true);
}
ref<EvalState> SourceExprCommand::getEvalState()
@@ -157,13 +157,11 @@ struct InstallableFlake : InstallableValue
Value * toValue(EvalState & state) override
{
- auto path = std::get_if<FlakeRef::IsPath>(&flakeRef.data);
- if (cmd.updateLockFile && path) {
- updateLockFile(state, path->path);
- }
-
auto vFlake = state.allocValue();
- makeFlakeValue(state, flakeRef, AllowRegistryAtTop, *vFlake);
+ if (std::get_if<FlakeRef::IsPath>(&flakeRef.data))
+ updateLockFile(state, flakeRef.to_string(), cmd.recreateLockFile);
+
+ makeFlakeValue(state, flakeRef, AllowRegistryAtTop, *vFlake, cmd.recreateLockFile);
auto vProvides = (*vFlake->attrs->get(state.symbols.create("provides")))->value;