aboutsummaryrefslogtreecommitdiff
path: root/src/nix/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/build.cc')
-rw-r--r--src/nix/build.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/nix/build.cc b/src/nix/build.cc
index da7c7f614..a6fcf5094 100644
--- a/src/nix/build.cc
+++ b/src/nix/build.cc
@@ -11,7 +11,7 @@ struct CmdBuild : MixDryRun, InstallablesCommand
{
Path outLink = "result";
- std::optional<std::string> gitRepo = std::nullopt;
+ bool updateLock = true;
CmdBuild()
{
@@ -28,9 +28,9 @@ struct CmdBuild : MixDryRun, InstallablesCommand
.set(&outLink, Path(""));
mkFlag()
- .longName("update-lock-file")
- .description("update the lock file")
- .dest(&gitRepo);
+ .longName("no-update")
+ .description("don't update the lock file")
+ .set(&updateLock, false);
}
std::string name() override
@@ -78,8 +78,10 @@ struct CmdBuild : MixDryRun, InstallablesCommand
}
}
- if (gitRepo)
- updateLockFile(*evalState, *gitRepo);
+ if(updateLock)
+ for (int i = 0; i < installables.size(); i++)
+ if (auto flakeUri = installableToFlakeUri)
+ updateLockFile(*evalState, FlakeRef(*flakeUri));
}
};