sunshine: fix hash refresh in update script

Signed-off-by: Anish Pallati <i@anish.land>
This commit is contained in:
Anish Pallati
2026-09-15 14:41:52 -04:00
parent 67d12d2322
commit 606402b890

View File

@@ -50,7 +50,7 @@ log "src hash: $src_hash"
log "Patching src hash in $package_nix"
# The src fetchFromGitHub is the only one with fetchSubmodules; anchor on it so
# we don't touch the ffmpeg or npmDepsHash entries. sed -z spans newlines.
sed -i -zE "s#hash = \"sha256-[A-Za-z0-9+/=]+\"(\\s*fetchSubmodules = true;)#hash = \"$src_hash\"\\1#" "$package_nix"
sed -i -zE "s#hash = \"sha256-[A-Za-z0-9+/=]+\";(\\s*fetchSubmodules = true;)#hash = \"$src_hash\";\\1#" "$package_nix"
if ! grep -q "$src_hash" "$package_nix"; then
echo "ERROR: failed to write src hash into $package_nix" >&2
@@ -84,7 +84,7 @@ log "build-deps tag: $build_deps_tag"
prefetch_unpacked_sri() {
local raw
raw=$(nix-prefetch-url --unpack --type sha256 "$1")
nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri "$raw"
nix-hash --type sha256 --to-sri "$raw"
}
ffmpeg_url() {