mochi/nixos/overlays/termius/retrive-latest-sri.sh
Joseph Hanson e5714f305a
add sri script for easy updates
TODO: Make this a nix common-updater script.
2024-09-05 21:42:01 -05:00

10 lines
548 B
Bash
Executable file

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq nix
VERSION=$(curl -H 'X-Ubuntu-Series: 16' https://api.snapcraft.io/api/v1/snaps/details/termius-app | jq '.version')
DOWNLOAD_URL=$(curl -H 'X-Ubuntu-Series: 16' https://api.snapcraft.io/api/v1/snaps/details/termius-app | jq '.download_url' -r)
SHASUM=$(curl -H 'X-Ubuntu-Series: 16' https://api.snapcraft.io/api/v1/snaps/details/termius-app | jq '.download_sha512' -r)
SRI512SUM=$(nix-hash --type sha512 --to-sri $SHASUM)
echo "The latest SRI for version $VERSION is "
echo "$SRI512SUM"