Skip to content

Commit

Permalink
snipaste: 2.9.2-Beta -> 2.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
L-Trump committed Oct 19, 2024
1 parent a3c0b3b commit 36195e9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkgs/by-name/sn/snipaste/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@
}:
appimageTools.wrapType2 rec {
pname = "snipaste";
version = "2.9.2-Beta";
version = "2.10.2";

src = fetchurl {
url = "https://download.snipaste.com/archives/Snipaste-${version}-x86_64.AppImage";
hash = "sha256-oV69uABjzkbQdwb+1wRRxszhrwI4uyzhQZ4aXBnyeo8=";
hash = "sha256-u9e2d9ZpHDbDIsFkseOdJX2Kspn9TkhFfZxbeielDA8=";
};

passthru.updateScript = ./update.sh;

meta = {
description = "Screenshot tools";
homepage = "https://www.snipaste.com/";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
maintainers = with lib.maintainers; [
luftmensch-luftmensch
ltrump
];
mainProgram = "snipaste";
platforms = [ "x86_64-linux" ];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
Expand Down
15 changes: 15 additions & 0 deletions pkgs/by-name/sn/snipaste/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash curl coreutils jq common-updater-scripts

latestTag=$(curl -sSfL https://www.snipaste.com/linux_version | jq -r ".subject")
latestVersion="$(expr "$latestTag" : 'v\(.*\)')"
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; snipaste.version" | tr -d '"')

if [[ "$latestVersion" == "$currentVersion" ]]; then
echo "package is up-to-date"
exit 0
fi

prefetch=$(nix-prefetch-url "https://download.snipaste.com/archives/Snipaste-$latestVersion-x86_64.AppImage")
hash=$(nix-hash --type sha256 --to-sri "$prefetch")
update-source-version snipaste "$latestVersion" "$hash" --ignore-same-version

0 comments on commit 36195e9

Please sign in to comment.