From 60ef712fac2f67eb7447db41ad01784d0249810a Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sat, 25 Oct 2025 17:24:37 +0200 Subject: [PATCH] Fix hash conversion in NixOS update workflow - Replace xxd with Python for hex to base64 conversion - Use standard tools available in GitHub Actions runners - Should fix hash conversion error in automated workflow --- .gitea/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index a96eaf6..a2b26eb 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -108,8 +108,9 @@ jobs: # Download tarball to get correct hash curl -L -o cm-dashboard.tar.gz "$TARBALL_URL" + # Convert sha256 hex to base64 for Nix hash format using Python NEW_HASH=$(sha256sum cm-dashboard.tar.gz | cut -d' ' -f1) - NIX_HASH="sha256-$(echo -n $NEW_HASH | xxd -r -p | base64)" + NIX_HASH="sha256-$(python3 -c "import base64, binascii; print(base64.b64encode(binascii.unhexlify('$NEW_HASH')).decode())")" # Update the NixOS configuration sed -i "s/version = \"v[^\"]*\"/version = \"$VERSION\"/" hosts/common/cm-dashboard.nix