Use nix eval for cache path detection instead of --dry-run
All checks were successful
CI / check (pull_request) Successful in 5m15s
CI / build-and-cache (pull_request) Has been skipped

This commit is contained in:
mayor
2026-02-14 18:25:03 -08:00
committed by John Ogle
parent acd9d8d70f
commit cd7439b132

View File

@@ -61,7 +61,7 @@ jobs:
echo "::group::Building $pkg" echo "::group::Building $pkg"
# Check if package is already cached by evaluating its store path and checking the remote # Check if package is already cached by evaluating its store path and checking the remote
OUT_PATH=$(nix build ".#$pkg" --no-link --print-out-paths --dry-run 2>/dev/null | grep '^/nix/store/' | tail -1) OUT_PATH=$(nix eval ".#$pkg.outPath" --raw 2>/dev/null)
if [ -n "$OUT_PATH" ] && ssh -i ~/.ssh/cache_key ${{ secrets.CACHE_USER }}@${{ secrets.CACHE_HOST }} \ if [ -n "$OUT_PATH" ] && ssh -i ~/.ssh/cache_key ${{ secrets.CACHE_USER }}@${{ secrets.CACHE_HOST }} \
"nix path-info '$OUT_PATH' >/dev/null 2>&1"; then "nix path-info '$OUT_PATH' >/dev/null 2>&1"; then
echo "⏭ $pkg already cached ($OUT_PATH), skipping" echo "⏭ $pkg already cached ($OUT_PATH), skipping"