1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 10:11:47 +02:00

Merge remote-tracking branch 'origin/2.26-maintenance' into sync-with-2.26

This commit is contained in:
Eelco Dolstra 2025-03-05 18:01:03 +01:00
commit 25ba7c55d3
5 changed files with 157 additions and 95 deletions

View file

@ -99,6 +99,16 @@ writeTrivialFlake() {
EOF
}
initGitRepo() {
local repo="$1"
local extraArgs="${2-}"
# shellcheck disable=SC2086 # word splitting of extraArgs is intended
git -C "$repo" init $extraArgs
git -C "$repo" config user.email "foobar@example.com"
git -C "$repo" config user.name "Foobar"
}
createGitRepo() {
local repo="$1"
local extraArgs="${2-}"
@ -107,7 +117,5 @@ createGitRepo() {
mkdir -p "$repo"
# shellcheck disable=SC2086 # word splitting of extraArgs is intended
git -C "$repo" init $extraArgs
git -C "$repo" config user.email "foobar@example.com"
git -C "$repo" config user.name "Foobar"
initGitRepo "$repo" $extraArgs
}

View file

@ -45,7 +45,7 @@ EOF
[[ $(nix eval "$rootFlake?dir=sub1#y") = 6 ]]
git init "$rootFlake"
initGitRepo "$rootFlake"
git -C "$rootFlake" add flake.nix sub0/flake.nix sub1/flake.nix
[[ $(nix eval "$subflake1#y") = 6 ]]
@ -77,7 +77,17 @@ fi
(! grep narHash "$subflake2/flake.lock")
# Test `nix flake archive` with relative path flakes.
nix flake archive --json "$rootFlake"
git -C "$rootFlake" add flake.lock
git -C "$rootFlake" commit -a -m Foo
json=$(nix flake archive --json "$rootFlake" --to "$TEST_ROOT/store2")
[[ $(echo "$json" | jq .inputs.sub0.inputs) = {} ]]
[[ -n $(echo "$json" | jq .path) ]]
#nix flake prefetch --out-link "$TEST_ROOT/result" "$rootFlake"
#outPath=$(readlink "$TEST_ROOT/result")
#[ -e "$TEST_ROOT/store2/nix/store/$(basename "$outPath")" ]
# Test circular relative path flakes. FIXME: doesn't work at the moment.
if false; then