source ./common.sh requireGit flakeFollowsA=$TEST_ROOT/follows/flakeA flakeFollowsB=$TEST_ROOT/follows/flakeA/flakeB flakeFollowsC=$TEST_ROOT/follows/flakeA/flakeB/flakeC flakeFollowsD=$TEST_ROOT/follows/flakeA/flakeD flakeFollowsE=$TEST_ROOT/follows/flakeA/flakeE # Test following path flakerefs. createGitRepo $flakeFollowsA mkdir -p $flakeFollowsB mkdir -p $flakeFollowsC mkdir -p $flakeFollowsD mkdir -p $flakeFollowsE cat > $flakeFollowsA/flake.nix < $flakeFollowsB/flake.nix < $flakeFollowsC/flake.nix < $flakeFollowsD/flake.nix < $flakeFollowsE/flake.nix < $flakeFollowsA/flake.nix < $flakeFollowsA/flake.nix <&1 | grep 'points outside' # Non-existant follows should print a warning. cat >$flakeFollowsA/flake.nix <&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 < $flakeFollowsD/flake.nix { outputs = _: {}; } EOF cat < $flakeFollowsC/flake.nix { inputs.D.url = "path:nosuchflake"; outputs = _: {}; } EOF cat < $flakeFollowsB/flake.nix { inputs.C.url = "path:$flakeFollowsC"; outputs = _: {}; } EOF cat < $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"]' ]]