homepage-dashboard: fix update script

A slight logic error in the update script meant
that the source hash wasn't being updated
according to the new version of the source.

This commit fixes that, and the following commits
contain changes generated by this revision of the
update script.
This commit is contained in:
Jon Seager
2025-04-30 16:53:50 +01:00
parent cf7fcaf4d9
commit 334faf28c5
+4 -4
View File
@@ -34,12 +34,12 @@ update_homepage_dashboard_source() {
local version; version="$1"
echo "Updating homepage-dashboard source"
old_hash="$(nix eval --json --impure --expr "(import $nixpkgs/default.nix {}).homepage-dashboard.src.outputHash" | jq -r)"
old_version="$(nix eval --json --impure --expr "(import $nixpkgs/default.nix {}).homepage-dashboard.version" | jq -r)"
new_hash="$(nix-build --impure --expr "let src = (import $nixpkgs/default.nix {}).homepage-dashboard.src; in (src.overrideAttrs or (f: src // f src)) (_: { version = \"$version\"; outputHash = \"\"; outputHashAlgo = \"sha256\"; })" 2>&1 | tr -s ' ' | grep -Po "got: \K.+$")" || true
sed -i "s|${old_hash}|${new_hash}|g" package.nix
sed -i "s|${old_version}|${version}|g" package.nix
old_hash="$(nix eval --json --impure --expr "(import $nixpkgs/default.nix {}).homepage-dashboard.src.outputHash" | jq -r)"
new_hash="$(nix-build --impure --expr "let src = (import $nixpkgs/default.nix {}).homepage-dashboard.src; in (src.overrideAttrs or (f: src // f src)) (_: { version = \"$version\"; outputHash = \"\"; outputHashAlgo = \"sha256\"; })" 2>&1 | tr -s ' ' | grep -Po "got: \K.+$")" || true
sed -i "s|${old_hash}|${new_hash}|g" package.nix
}
# Update the hash of the homepage-dashboard pnpm dependencies in the Nix expression.