aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-07-10 10:27:33 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-07-10 10:27:33 +0200
commitb0c220c02ec584af282b9c7f493e4a4d2e429f8c (patch)
tree9965194f84e7e27b9c673e3b4859215d43788b69
parentcc218b15bad7d1883ac951bc48a8285fcef78916 (diff)
Check for epochs < 201906
-rw-r--r--src/libexpr/flake/flake.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc
index 302549a3c..4f59c61bd 100644
--- a/src/libexpr/flake/flake.cc
+++ b/src/libexpr/flake/flake.cc
@@ -227,6 +227,8 @@ Flake getFlake(EvalState & state, const FlakeRef & flakeRef)
if (auto epoch = vInfo.attrs->get(sEpoch)) {
flake.epoch = state.forceInt(*(**epoch).value, *(**epoch).pos);
+ if (flake.epoch < 201906)
+ throw Error("flake '%s' has illegal epoch %d", flakeRef, flake.epoch);
if (flake.epoch > 201906)
throw Error("flake '%s' requires unsupported epoch %d; please upgrade Nix", flakeRef, flake.epoch);
} else