wavebox: add update script

This commit is contained in:
FliegendeWurst 2023-10-03 08:42:40 +02:00
parent 90c31a3d12
commit 35c9d66a03
2 changed files with 17 additions and 0 deletions

View File

@ -79,6 +79,8 @@ stdenv.mkDerivation {
--prefix PATH : ${xdg-utils}/bin
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Wavebox messaging application";
homepage = "https://wavebox.io";

View File

@ -0,0 +1,15 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils curl gnugrep
set -euo pipefail
cd $(dirname "${BASH_SOURCE[0]}")
setKV () {
sed -i "s|$2 = \".*\"|$2 = \"${3:-}\"|" $1
}
version=$(curl -LIs --show-error -o /dev/null -w %{url_effective} 'https://download.wavebox.app/latest/stable/linux/tar' | grep -oP 'Wavebox_\K(.+)(?=.tar.gz)')
sha256_linux64=$(nix-prefetch-url --quiet https://download.wavebox.app/stable/linux/tar/Wavebox_${version}.tar.gz)
setKV ./default.nix version $version
setKV ./default.nix sha256 "$sha256_linux64"