From 5cae547f8d04b15cf129908bd299d80e4953c35d Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 15 Jun 2025 22:26:43 +0200 Subject: [PATCH] chore: :green_heart: Update Nix hashes --- pnpm-lock.yaml | 24 ++++++++++++++++++++++++ scripts/update-nix.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 scripts/update-nix.sh diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 19f12bdd..464080a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -275,6 +275,9 @@ importers: '@versia-server/config': specifier: workspace:* version: link:packages/config + '@versia-server/tests': + specifier: workspace:* + version: link:packages/tests '@versia/client': specifier: workspace:* version: link:packages/client @@ -471,6 +474,9 @@ importers: '@versia-server/config': specifier: workspace:* version: link:../config + '@versia-server/tests': + specifier: workspace:* + version: link:../tests '@versia/client': specifier: workspace:* version: link:../client @@ -637,6 +643,24 @@ importers: specifier: 'catalog:' version: 3.25.64 + packages/tests: + dependencies: + '@versia-server/config': + specifier: workspace:* + version: link:../config + '@versia/client': + specifier: workspace:* + version: link:../client + '@versia/kit': + specifier: workspace:* + version: link:../plugin-kit + altcha-lib: + specifier: 'catalog:' + version: 1.3.0 + drizzle-orm: + specifier: 'catalog:' + version: 0.44.2(@opentelemetry/api@1.9.0)(@types/pg@8.6.1)(bun-types@1.2.16) + packages/worker: dependencies: '@logtape/logtape': diff --git a/scripts/update-nix.sh b/scripts/update-nix.sh new file mode 100644 index 00000000..3e149199 --- /dev/null +++ b/scripts/update-nix.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Step 1: Run pnpm install +pnpm i --lockfile-only + +# Step 2: Blank the hash in package.nix +sed -i 's/hash = ".*";/hash = lib.fakeHash;/g' nix/package.nix + +echo "Running nix build to get the correct hash..." + +# Step 3: Run nix build and capture stderr +build_output=$(nix build .#versia-server 2>&1 || true) + +# Step 4: Extract the corrected hash from the output +corrected_hash=$(echo "$build_output" | grep 'got:' | awk '{print $2}') + +echo "Corrected hash: $corrected_hash" + +# Step 5: Replace the blank hash with the corrected one +sed -i "s/hash = lib.fakeHash;/hash = \"$corrected_hash\";/g" nix/package.nix + +echo "Rebuilding with the corrected hash..." + +# Step 6: Build again +nix build .#versia-server