1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-15 21:41:04 +01:00

nix flake clone: Support all input types

For input types that have no concept of cloning, we now default to
copying the entire source tree.
This commit is contained in:
Eelco Dolstra 2025-11-17 19:27:45 +01:00
parent 95da93c05b
commit d07c24f4c8
6 changed files with 34 additions and 14 deletions

View file

@ -369,6 +369,10 @@ tar cfz "$TEST_ROOT"/flake.tar.gz -C "$TEST_ROOT" flake5
nix build -o "$TEST_ROOT"/result file://"$TEST_ROOT"/flake.tar.gz
nix flake clone "file://$TEST_ROOT/flake.tar.gz" --dest "$TEST_ROOT/unpacked"
[[ -e $TEST_ROOT/unpacked/flake.nix ]]
expectStderr 1 nix flake clone "file://$TEST_ROOT/flake.tar.gz" --dest "$TEST_ROOT/unpacked" | grep 'existing path'
# Building with a tarball URL containing a SRI hash should also work.
url=$(nix flake metadata --json file://"$TEST_ROOT"/flake.tar.gz | jq -r .url)
[[ $url =~ sha256- ]]