diff options
Diffstat (limited to 'pkgs/applications/misc/remnote/default.nix')
-rw-r--r-- | pkgs/applications/misc/remnote/default.nix | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/pkgs/applications/misc/remnote/default.nix b/pkgs/applications/misc/remnote/default.nix index 0f6be51187fa1..b86a69ea2794c 100644 --- a/pkgs/applications/misc/remnote/default.nix +++ b/pkgs/applications/misc/remnote/default.nix @@ -2,13 +2,14 @@ lib, fetchurl, appimageTools, + writeScript, }: let pname = "remnote"; - version = "1.16.18"; + version = "1.16.48"; src = fetchurl { url = "https://download2.remnote.io/remnote-desktop2/RemNote-${version}.AppImage"; - hash = "sha256-ps7Rl1oA2QOPvO2XeCY8DrWtCV9WPlX9jbhypz2ZARA="; + hash = "sha256-tECIn43fTr+Enkp63S7INUjOrs8Ni7Nmhxsr/p6kPzo="; }; appimageContents = appimageTools.extractType2 { inherit pname version src; }; in @@ -22,6 +23,19 @@ appimageTools.wrapType2 { install -Dm444 ${appimageContents}/remnote.png -t $out/share/pixmaps ''; + passthru.updateScript = writeScript "update.sh" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl coreutils gnused common-updater-scripts + set -eu -o pipefail + url="$(curl -ILs -w %{url_effective} -o /dev/null https://backend.remnote.com/desktop/linux)" + version="$(echo $url | sed -n 's/.*RemNote-\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p')" + currentVersion=$(nix-instantiate --eval -E "with import ./. {}; remnote.version or (lib.getVersion remnote)" | tr -d '"') + if [[ "$version" != "$currentVersion" ]]; then + hash=$(nix-hash --to-sri --type sha256 "$(nix-prefetch-url "$url")") + update-source-version remnote "$version" "$hash" --print-changes + fi + ''; + meta = with lib; { description = "Note-taking application focused on learning and productivity"; homepage = "https://remnote.com/"; |