aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/flakes/subdir-flake.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/flakes/subdir-flake.sh')
-rw-r--r--tests/functional/flakes/subdir-flake.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/functional/flakes/subdir-flake.sh b/tests/functional/flakes/subdir-flake.sh
new file mode 100644
index 000000000..399518502
--- /dev/null
+++ b/tests/functional/flakes/subdir-flake.sh
@@ -0,0 +1,20 @@
+source common.sh
+requireGit
+clearStore
+
+container="$TEST_HOME"/flake-container
+flake_dir="$container"/flake-dir
+
+createGitRepo "$container"
+mkdir -p "$flake_dir"
+writeSimpleFlake "$flake_dir"
+git -C "$container" add flake-dir
+
+pushd "$flake_dir" &>/dev/null
+ info="$(nix flake info --json)"
+ [[ "$(jq -r '.resolvedUrl' <<<"$info")" == git+file://*/flake-container?dir=flake-dir ]]
+ [[ "$(jq -r '.url' <<<"$info")" == git+file://*/flake-container?dir=flake-dir ]]
+
+ # Make sure we can actually access & build stuff in this flake.
+ nix build "path:$flake_dir#foo" -L
+popd &>/dev/null