diff --git a/src/libflake/flake/flakeref.cc b/src/libflake/flake/flakeref.cc index cdb3c272f..eaafa9967 100644 --- a/src/libflake/flake/flakeref.cc +++ b/src/libflake/flake/flakeref.cc @@ -233,7 +233,7 @@ std::optional> parseURLFlakeRef( try { auto parsed = parseURL(url); if (baseDir - && (parsed.scheme == "path" || parsed.scheme == "git+file") + && parsed.scheme == "path" && !isAbsolute(parsed.path)) parsed.path = absPath(parsed.path, *baseDir); return fromParsedURL(fetchSettings, std::move(parsed), isFlake); diff --git a/tests/functional/flakes/flakes.sh b/tests/functional/flakes/flakes.sh index e3c3fa3b7..d90c416ef 100755 --- a/tests/functional/flakes/flakes.sh +++ b/tests/functional/flakes/flakes.sh @@ -224,7 +224,6 @@ nix build -o "$TEST_ROOT/result" "$flake1Dir" nix build -o "$TEST_ROOT/result" "git+file://$flake1Dir" (cd "$flake1Dir" && nix build -o "$TEST_ROOT/result" ".") (cd "$flake1Dir" && nix build -o "$TEST_ROOT/result" "path:.") -(cd "$flake1Dir" && nix build -o "$TEST_ROOT/result" "git+file:.") # Test explicit packages.default. nix build -o "$TEST_ROOT/result" "$flake1Dir#default"