diff options
author | Nick Van den Broeck <nick.van.den.broeck666@gmail.com> | 2019-03-21 09:30:16 +0100 |
---|---|---|
committer | Nick Van den Broeck <nick.van.den.broeck666@gmail.com> | 2019-04-09 08:38:09 +0200 |
commit | 18c019b616f457b1f9a39da8cafc012be5ddffcc (patch) | |
tree | c5111099f1ff57227100db7ab862159dfaca30a5 /src/nix/build.cc | |
parent | 87033f2c4e32f4851e8c2abf8ab3b56444b65590 (diff) |
Added nonFlakeRequires and the command `nix flake deps`
Diffstat (limited to 'src/nix/build.cc')
-rw-r--r-- | src/nix/build.cc | 14 |
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)); } }; |