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.cc30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/nix/installables.cc b/src/nix/installables.cc
index 7d59a25ee..24eb739f5 100644
--- a/src/nix/installables.cc
+++ b/src/nix/installables.cc
@@ -22,17 +22,22 @@ MixFlakeOptions::MixFlakeOptions()
mkFlag()
.longName("recreate-lock-file")
.description("recreate lock file from scratch")
- .set(&recreateLockFile, true);
+ .set(&lockFlags.recreateLockFile, true);
mkFlag()
- .longName("no-save-lock-file")
- .description("do not save the newly generated lock file")
- .set(&saveLockFile, false);
+ .longName("no-update-lock-file")
+ .description("do not allow any updates to the lock file")
+ .set(&lockFlags.updateLockFile, false);
+
+ mkFlag()
+ .longName("no-write-lock-file")
+ .description("do not write the newly generated lock file")
+ .set(&lockFlags.writeLockFile, false);
mkFlag()
.longName("no-registries")
.description("don't use flake registries")
- .set(&useRegistries, false);
+ .set(&lockFlags.useRegistries, false);
mkFlag()
.longName("override-input")
@@ -46,17 +51,6 @@ MixFlakeOptions::MixFlakeOptions()
});
}
-flake::LockFileMode MixFlakeOptions::getLockFileMode()
-{
- using namespace flake;
- return
- useRegistries
- ? recreateLockFile
- ? (saveLockFile ? RecreateLockFile : UseNewLockFile)
- : (saveLockFile ? UpdateLockFile : UseUpdatedLockFile)
- : AllPure;
-}
-
SourceExprCommand::SourceExprCommand()
{
mkFlag()
@@ -332,7 +326,7 @@ std::tuple<std::string, FlakeRef, flake::EvalCache::Derivation> InstallableFlake
{
auto state = cmd.getEvalState();
- auto lockedFlake = lockFlake(*state, flakeRef, cmd.getLockFileMode(), cmd.lockFlags);
+ auto lockedFlake = lockFlake(*state, flakeRef, cmd.lockFlags);
Value * vOutputs = nullptr;
@@ -386,7 +380,7 @@ std::vector<flake::EvalCache::Derivation> InstallableFlake::toDerivations()
Value * InstallableFlake::toValue(EvalState & state)
{
- auto lockedFlake = lockFlake(state, flakeRef, cmd.getLockFileMode(), cmd.lockFlags);
+ auto lockedFlake = lockFlake(state, flakeRef, cmd.lockFlags);
auto vOutputs = getFlakeOutputs(state, lockedFlake);