aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-04-17 13:54:06 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-04-17 13:54:06 +0200
commit160b974fb0623df436c9e834f6d4db62dfda02d2 (patch)
tree89a75df20b2998ab3b6a17239209b84abc2b2bce
parent939bee06cd7c68af1508fab127202689fc63c22e (diff)
Fix mutability check
-rw-r--r--src/libexpr/primops/flake.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libexpr/primops/flake.cc b/src/libexpr/primops/flake.cc
index 296db3f92..0bf666a98 100644
--- a/src/libexpr/primops/flake.cc
+++ b/src/libexpr/primops/flake.cc
@@ -193,10 +193,11 @@ static FlakeSourceInfo fetchFlake(EvalState & state, const FlakeRef flakeRef, bo
FlakeRef fRef = lookupFlake(state, flakeRef,
impureIsAllowed ? state.getFlakeRegistries() : std::vector<std::shared_ptr<FlakeRegistry>>());
+ if (evalSettings.pureEval && !impureIsAllowed && !fRef.isImmutable())
+ throw Error("requested to fetch mutable flake '%s' in pure mode", fRef.to_string());
+
// This only downloads only one revision of the repo, not the entire history.
if (auto refData = std::get_if<FlakeRef::IsGitHub>(&fRef.data)) {
- if (evalSettings.pureEval && !impureIsAllowed && !fRef.isImmutable())
- throw Error("requested to fetch FlakeRef '%s' purely, which is mutable", fRef.to_string());
// FIXME: use regular /archive URLs instead? api.github.com
// might have stricter rate limits.