2024-05-28 16:43:04 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2021-04-09 21:13:08 +00:00
|
|
|
source common.sh
|
|
|
|
|
2024-06-16 10:51:46 +00:00
|
|
|
TODO_NixOS
|
|
|
|
|
2021-04-09 21:13:08 +00:00
|
|
|
clearStore
|
|
|
|
clearCache
|
|
|
|
|
|
|
|
cacheURI="file://$cacheDir?compression=zstd"
|
|
|
|
|
|
|
|
outPath=$(nix-build dependencies.nix --no-out-link)
|
|
|
|
|
2024-10-30 04:33:28 +00:00
|
|
|
nix copy --to "$cacheURI" "$outPath"
|
2021-04-09 21:13:08 +00:00
|
|
|
|
2024-10-30 04:33:28 +00:00
|
|
|
HASH=$(nix hash path "$outPath")
|
2021-04-09 21:13:08 +00:00
|
|
|
|
|
|
|
clearStore
|
|
|
|
clearCacheCache
|
|
|
|
|
2024-11-04 13:52:56 +00:00
|
|
|
nix copy --from "$cacheURI" "$outPath" --no-check-sigs --profile "$TEST_ROOT/profile" --out-link "$TEST_ROOT/result"
|
2024-10-08 13:28:49 +00:00
|
|
|
|
|
|
|
[[ -e $TEST_ROOT/profile ]]
|
2024-10-08 14:35:53 +00:00
|
|
|
[[ -e $TEST_ROOT/result ]]
|
2021-04-09 21:13:08 +00:00
|
|
|
|
2024-10-30 04:33:28 +00:00
|
|
|
if ls "$cacheDir/nar/"*.zst &> /dev/null; then
|
2021-04-09 21:13:08 +00:00
|
|
|
echo "files do exist"
|
|
|
|
else
|
|
|
|
echo "nars do not exist"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-10-30 04:33:28 +00:00
|
|
|
HASH2=$(nix hash path "$outPath")
|
2021-04-09 21:13:08 +00:00
|
|
|
|
2024-10-30 04:33:28 +00:00
|
|
|
[[ "$HASH" = "$HASH2" ]]
|