tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
0
fork
atom
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
0
fork
atom
overview
issues
pulls
pipelines
snipaste: add updateScript
L-Trump
2 years ago
117bafd4
77514565
+17
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
sn
snipaste
package.nix
update.sh
+2
pkgs/by-name/sn/snipaste/package.nix
reviewed
···
12
12
hash = "sha256-u9e2d9ZpHDbDIsFkseOdJX2Kspn9TkhFfZxbeielDA8=";
13
13
};
14
14
15
15
+
passthru.updateScript = ./update.sh;
16
16
+
15
17
meta = {
16
18
description = "Screenshot tools";
17
19
homepage = "https://www.snipaste.com/";
+15
pkgs/by-name/sn/snipaste/update.sh
reviewed
···
1
1
+
#!/usr/bin/env nix-shell
2
2
+
#!nix-shell -i bash -p bash curl coreutils jq common-updater-scripts
3
3
+
4
4
+
latestTag=$(curl -sSfL https://www.snipaste.com/linux_version | jq -r ".subject")
5
5
+
latestVersion="$(expr "$latestTag" : 'v\(.*\)')"
6
6
+
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; snipaste.version" | tr -d '"')
7
7
+
8
8
+
if [[ "$latestVersion" == "$currentVersion" ]]; then
9
9
+
echo "package is up-to-date"
10
10
+
exit 0
11
11
+
fi
12
12
+
13
13
+
prefetch=$(nix-prefetch-url "https://download.snipaste.com/archives/Snipaste-$latestVersion-x86_64.AppImage")
14
14
+
hash=$(nix-hash --type sha256 --to-sri "$prefetch")
15
15
+
update-source-version snipaste "$latestVersion" "$hash" --ignore-same-version