Files
nixpkgs/pkgs/by-name/si/simplex-chat-desktop/update.sh
Terry Garcia ec5d28b85b simplex-chat-desktop: fix updates for aarch64-linux
Replace gitUpdater with a shell script that invokes
update-source-version once per system using
--source-key, so both per-arch AppImage hashes are
refreshed on each version bump.
2026-05-24 14:08:58 -05:00

33 lines
974 B
Bash
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
set -euo pipefail
attr="simplex-chat-desktop"
# Get the latest non-prerelease tag from GitHub.
latest=$(curl -fsSL ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} \
"https://api.github.com/repos/simplex-chat/simplex-chat/releases/latest" \
| jq -r '.tag_name')
# Strip the leading "v".
version="${latest#v}"
# Current version in nixpkgs (so we can short-circuit if unchanged).
current=$(nix-instantiate --eval -E "with import ./. {}; ${attr}.version" \
| tr -d '"')
if [[ "$version" == "$current" ]]; then
echo "${attr} is already at ${version}"
exit 0
fi
# Update each per-system source independently.
update-source-version "$attr" "$version" \
--source-key=sources.x86_64-linux
# --ignore-same-version flag silences warning because previous invocation bumped version
update-source-version "$attr" "$version" \
--ignore-same-version \
--source-key=sources.aarch64-linux