aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}