aboutsummaryrefslogtreecommitdiff
path: root/tests/flakes
diff options
context:
space:
mode:
Diffstat (limited to 'tests/flakes')
-rw-r--r--tests/flakes/follow-paths.sh30
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"]' ]]