diff options
author | Sebastian Ullrich <sebasti@nullri.ch> | 2022-06-05 22:45:37 +0200 |
---|---|---|
committer | Sebastian Ullrich <sebasti@nullri.ch> | 2022-08-28 11:47:25 +0200 |
commit | 2b9d38130161116081d24630b99d1a437fa3bdb2 (patch) | |
tree | e287c00299dfcb68602951c4e6380d3cdd5909c0 /tests | |
parent | 7918adbb628e7781cec1638c371f2009136be68a (diff) |
Fix nested flake input overrides
Diffstat (limited to 'tests')
-rw-r--r-- | tests/flakes/follow-paths.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/flakes/follow-paths.sh b/tests/flakes/follow-paths.sh index 19cc1bafa..e6751b06e 100644 --- a/tests/flakes/follow-paths.sh +++ b/tests/flakes/follow-paths.sh @@ -148,3 +148,33 @@ git -C $flakeFollowsA add flake.nix nix flake lock $flakeFollowsA 2>&1 | grep "warning: input 'B' has an override for a non-existent input 'invalid'" nix flake lock $flakeFollowsA 2>&1 | grep "warning: input 'B' has an override for a non-existent input 'invalid2'" + +# Test nested flake overrides + +cat <<EOF > $flakeFollowsD/flake.nix +{ outputs = _: {}; } +EOF +cat <<EOF > $flakeFollowsC/flake.nix +{ + inputs.D.url = "path:nosuchflake"; + outputs = _: {}; +} +EOF +cat <<EOF > $flakeFollowsB/flake.nix +{ + inputs.C.url = "path:$flakeFollowsC"; + outputs = _: {}; +} +EOF +cat <<EOF > $flakeFollowsA/flake.nix +{ + inputs.B.url = "path:$flakeFollowsB"; + inputs.D.url = "path:$flakeFollowsD"; + inputs.B.inputs.C.inputs.D.follows = "D"; + outputs = _: {}; +} +EOF + +nix flake lock $flakeFollowsA + +[[ $(jq -c .nodes.C.inputs.D $flakeFollowsA/flake.lock) = '["D"]' ]] |