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.
This commit is contained in:
Eelco Dolstra 2019-05-09 13:59:50 +02:00
parent a746dc64d2
commit 391e1f511d
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -59,6 +59,25 @@ EOF
git -C $flake2 add flake.nix git -C $flake2 add flake.nix
git -C $flake2 commit -m 'Initial' 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 cat > $registry <<EOF
{ {
"flakes": { "flakes": {
@ -119,3 +138,6 @@ nix build -o $TEST_ROOT/result --flake-registry $registry flake2:bar
# Or without a registry. # Or without a registry.
nix build -o $TEST_ROOT/result file://$flake2:bar 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