aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-05-09 13:59:50 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-05-09 13:59:50 +0200
commit391e1f511d90461dcdd52e495e2596bbd2ea3c5a (patch)
tree55363622e80dfbc160985617d13c11ad0d86b90a
parenta746dc64d2fa45456817c6ef8a4f82c6217e0392 (diff)
Add test for indirect flake dependencies
I.e. flake3 depends on flake2 which depends on flake1. Currently this fails with error: indirect flake reference 'flake1' is not allowed because we're not propagating lockfiles downwards properly.
-rw-r--r--tests/flakes.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/flakes.sh b/tests/flakes.sh
index da952d552..7b827a418 100644
--- a/tests/flakes.sh
+++ b/tests/flakes.sh
@@ -59,6 +59,25 @@ EOF
git -C $flake2 add flake.nix
git -C $flake2 commit -m 'Initial'
+cat > $flake3/flake.nix <<EOF
+{
+ name = "flake3";
+
+ epoch = 2019;
+
+ requires = [ "flake2" ];
+
+ description = "Fnord";
+
+ provides = deps: rec {
+ packages.xyzzy = deps.flake2.provides.packages.bar;
+ };
+}
+EOF
+
+git -C $flake3 add flake.nix
+git -C $flake3 commit -m 'Initial'
+
cat > $registry <<EOF
{
"flakes": {
@@ -119,3 +138,6 @@ nix build -o $TEST_ROOT/result --flake-registry $registry flake2:bar
# Or without a registry.
nix build -o $TEST_ROOT/result file://$flake2:bar
+
+# Test whether indirect dependencies work.
+nix build -o $TEST_ROOT/result --flake-registry $registry $flake3:xyzzy