nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

snipaste: add updateScript

L-Trump 117bafd4 77514565

+17
+2
pkgs/by-name/sn/snipaste/package.nix
··· 12 12 hash = "sha256-u9e2d9ZpHDbDIsFkseOdJX2Kspn9TkhFfZxbeielDA8="; 13 13 }; 14 14 15 + passthru.updateScript = ./update.sh; 16 + 15 17 meta = { 16 18 description = "Screenshot tools"; 17 19 homepage = "https://www.snipaste.com/";
+15
pkgs/by-name/sn/snipaste/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p bash curl coreutils jq common-updater-scripts 3 + 4 + latestTag=$(curl -sSfL https://www.snipaste.com/linux_version | jq -r ".subject") 5 + latestVersion="$(expr "$latestTag" : 'v\(.*\)')" 6 + currentVersion=$(nix-instantiate --eval -E "with import ./. {}; snipaste.version" | tr -d '"') 7 + 8 + if [[ "$latestVersion" == "$currentVersion" ]]; then 9 + echo "package is up-to-date" 10 + exit 0 11 + fi 12 + 13 + prefetch=$(nix-prefetch-url "https://download.snipaste.com/archives/Snipaste-$latestVersion-x86_64.AppImage") 14 + hash=$(nix-hash --type sha256 --to-sri "$prefetch") 15 + update-source-version snipaste "$latestVersion" "$hash" --ignore-same-version