diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-06-03 15:36:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-03 15:36:43 +0200 |
commit | 412684f9dca4e6b8100c3c5e95bb92514d96fa57 (patch) | |
tree | f04f212c0384085d508f30ea05839ef752e6b6c3 | |
parent | 507c150034256117cd56e31944feedb8f2f3ff3e (diff) | |
parent | d9a6a75ed28c590dde2dba846e356cbcda38d977 (diff) |
Merge pull request #2914 from CSVdB/finegrainedEpochs
Made epochs more fine-grained
-rw-r--r-- | doc/flakes/design.md | 4 | ||||
-rw-r--r-- | flake.nix | 2 | ||||
-rw-r--r-- | src/libexpr/primops/flake.cc | 2 | ||||
-rw-r--r-- | src/nix/flake-template.nix | 2 | ||||
-rw-r--r-- | tests/flakes.sh | 12 |
5 files changed, 11 insertions, 11 deletions
diff --git a/doc/flakes/design.md b/doc/flakes/design.md index 4f6524f83..63198e577 100644 --- a/doc/flakes/design.md +++ b/doc/flakes/design.md @@ -96,7 +96,7 @@ module. # The epoch may be used in the future to determine how Nix # expressions inside this flake are to be parsed. - epoch = 2018; + epoch = 201906; # Some other metadata. description = "A filesystem that fetches DWARF debug info from the Internet on demand"; @@ -164,7 +164,7 @@ Similarly, a minimal `flake.nix` for Nixpkgs: { name = "nixpkgs"; - epoch = 2018; + epoch = 201906; description = "A collection of packages for the Nix package manager"; @@ -3,7 +3,7 @@ description = "The purely functional package manager"; - epoch = 2019; + epoch = 201906; inputs = [ "nixpkgs" ]; diff --git a/src/libexpr/primops/flake.cc b/src/libexpr/primops/flake.cc index 235e10922..e5035c53a 100644 --- a/src/libexpr/primops/flake.cc +++ b/src/libexpr/primops/flake.cc @@ -312,7 +312,7 @@ Flake getFlake(EvalState & state, const FlakeRef & flakeRef, bool impureIsAllowe if (auto epoch = vInfo.attrs->get(sEpoch)) { flake.epoch = state.forceInt(*(**epoch).value, *(**epoch).pos); - if (flake.epoch > 2019) + if (flake.epoch > 201906) throw Error("flake '%s' requires unsupported epoch %d; please upgrade Nix", flakeRef, flake.epoch); } else throw Error("flake '%s' lacks attribute 'epoch'", flakeRef); diff --git a/src/nix/flake-template.nix b/src/nix/flake-template.nix index fe89e647e..bec613f6c 100644 --- a/src/nix/flake-template.nix +++ b/src/nix/flake-template.nix @@ -3,7 +3,7 @@ description = "A flake for building Hello World"; - epoch = 2019; + epoch = 201906; requires = [ "nixpkgs" ]; diff --git a/tests/flakes.sh b/tests/flakes.sh index c4dd8c333..998abfd09 100644 --- a/tests/flakes.sh +++ b/tests/flakes.sh @@ -29,7 +29,7 @@ cat > $flake1Dir/flake.nix <<EOF { name = "flake1"; - epoch = 2019; + epoch = 201906; description = "Bla bla"; @@ -48,7 +48,7 @@ cat > $flake2Dir/flake.nix <<EOF { name = "flake2"; - epoch = 2019; + epoch = 201906; inputs = [ "flake1" ]; @@ -67,7 +67,7 @@ cat > $flake3Dir/flake.nix <<EOF { name = "flake3"; - epoch = 2019; + epoch = 201906; inputs = [ "flake2" ]; @@ -169,7 +169,7 @@ cat > $flake3Dir/flake.nix <<EOF { name = "flake3"; - epoch = 2019; + epoch = 201906; inputs = [ "flake1" "flake2" ]; @@ -192,7 +192,7 @@ nix build -o $TEST_ROOT/result --flake-registry $registry $flake3Dir:sth [[ ! (-z $(git -C $flake3Dir diff master)) ]] # Unsupported epochs should be an error. -sed -i $flake3Dir/flake.nix -e s/2019/2030/ +sed -i $flake3Dir/flake.nix -e s/201906/201909/ nix build -o $TEST_ROOT/result --flake-registry $registry $flake3Dir:sth 2>&1 | grep 'unsupported epoch' # Test whether registry caching works. @@ -219,7 +219,7 @@ cat > $flake3Dir/flake.nix <<EOF { name = "flake3"; - epoch = 2019; + epoch = 201906; inputs = [ "flake1" "flake2" ]; |