aboutsummaryrefslogtreecommitdiff
path: root/src/nix/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-04-15 12:11:16 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-04-15 12:11:16 +0200
commita12cd535672737d40759e02356cf0b418182c619 (patch)
treee2ed9ce272bd7e144a7da6ef37b7f31e0436d800 /src/nix/build.cc
parentbe757d88d97656f0d8076ee4a4586bb4353e7657 (diff)
parent4bf3a8226badcdc70c013dfcfa266ee72f6cb89b (diff)
Merge remote-tracking branch 'tweag/automatedUpdate' into flakes
Diffstat (limited to 'src/nix/build.cc')
-rw-r--r--src/nix/build.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/nix/build.cc b/src/nix/build.cc
index 5a3d9d31a..ef6b48969 100644
--- a/src/nix/build.cc
+++ b/src/nix/build.cc
@@ -10,7 +10,7 @@ struct CmdBuild : MixDryRun, InstallablesCommand
{
Path outLink = "result";
- bool updateLock = true;
+ bool update = true;
CmdBuild()
{
@@ -29,7 +29,7 @@ struct CmdBuild : MixDryRun, InstallablesCommand
mkFlag()
.longName("no-update")
.description("don't update the lock file")
- .set(&updateLock, false);
+ .set(&update, false);
}
std::string name() override
@@ -77,11 +77,12 @@ struct CmdBuild : MixDryRun, InstallablesCommand
}
}
- // FlakeUri flakeUri = "";
- // if(updateLock)
- // for (uint i = 0; i < installables.size(); i++)
- // // if (auto flakeUri = installableToFlakeUri)
- // updateLockFile(*evalState, flakeUri);
+ if (update)
+ for (auto installable : installables) {
+ auto flakeUri = installable->installableToFlakeUri();
+ if (flakeUri)
+ updateLockFile(*evalState, *flakeUri);
+ }
}
};