aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-10-08 16:44:09 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-10-08 17:00:55 +0200
commita0bd088d8485039ccff7c7bab761cfce1b06a6e9 (patch)
tree68ea946d5111d1b9ddb8239718c73a2a166340d6
parent21304c11f926892b1a0098ba5d424445d5ae30d6 (diff)
Move addRegistrOverrides
-rw-r--r--src/nix/build.cc2
-rw-r--r--src/nix/flake.cc1
-rw-r--r--src/nix/installables.cc4
3 files changed, 3 insertions, 4 deletions
diff --git a/src/nix/build.cc b/src/nix/build.cc
index f63150012..4fd1de026 100644
--- a/src/nix/build.cc
+++ b/src/nix/build.cc
@@ -52,8 +52,6 @@ struct CmdBuild : MixDryRun, MixProfile, InstallablesCommand
{
auto buildables = build(store, dryRun ? DryRun : Build, installables);
- auto evalState = std::make_shared<EvalState>(searchPath, store);
- evalState->addRegistryOverrides(registryOverrides);
if (dryRun) return;
if (outLink != "") {
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index cf4fcf722..e6dc5680f 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -129,7 +129,6 @@ struct CmdFlakeDeps : FlakeCommand
void run(nix::ref<nix::Store> store) override
{
auto evalState = getEvalState();
- evalState->addRegistryOverrides(registryOverrides);
std::queue<ResolvedFlake> todo;
todo.push(resolveFlake());
diff --git a/src/nix/installables.cc b/src/nix/installables.cc
index 867133653..5611a84ae 100644
--- a/src/nix/installables.cc
+++ b/src/nix/installables.cc
@@ -56,8 +56,10 @@ SourceExprCommand::SourceExprCommand()
ref<EvalState> EvalCommand::getEvalState()
{
- if (!evalState)
+ if (!evalState) {
evalState = std::make_shared<EvalState>(searchPath, getStore());
+ evalState->addRegistryOverrides(registryOverrides);
+ }
return ref<EvalState>(evalState);
}