2023-10-09 19:29:22 +00:00
|
|
|
{
|
2024-06-05 15:53:02 +00:00
|
|
|
lib,
|
|
|
|
fetchurl,
|
|
|
|
appimageTools,
|
2024-07-01 15:47:52 +00:00
|
|
|
writeScript,
|
2024-06-05 15:53:02 +00:00
|
|
|
}:
|
|
|
|
let
|
2022-05-18 14:49:53 +00:00
|
|
|
pname = "remnote";
|
2024-10-09 16:51:18 +00:00
|
|
|
version = "1.16.127";
|
2022-05-18 14:49:53 +00:00
|
|
|
src = fetchurl {
|
2024-06-05 15:53:02 +00:00
|
|
|
url = "https://download2.remnote.io/remnote-desktop2/RemNote-${version}.AppImage";
|
2024-10-09 16:51:18 +00:00
|
|
|
hash = "sha256-VsS9RXbcu6aV7b+Bk3lB+x6/X/HxN5EoypFCn4qKNEk=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
2024-06-05 15:53:02 +00:00
|
|
|
appimageContents = appimageTools.extractType2 { inherit pname version src; };
|
|
|
|
in
|
|
|
|
appimageTools.wrapType2 {
|
|
|
|
inherit pname version src;
|
|
|
|
|
|
|
|
extraInstallCommands = ''
|
|
|
|
install -Dm444 ${appimageContents}/remnote.desktop -t $out/share/applications
|
|
|
|
substituteInPlace $out/share/applications/remnote.desktop \
|
|
|
|
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=remnote %u'
|
|
|
|
install -Dm444 ${appimageContents}/remnote.png -t $out/share/pixmaps
|
2023-10-09 19:29:22 +00:00
|
|
|
'';
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Note-taking application focused on learning and productivity";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "https://remnote.com/";
|
2024-06-20 14:57:18 +00:00
|
|
|
maintainers = with maintainers; [ chewblacka ];
|
2022-05-18 14:49:53 +00:00
|
|
|
license = licenses.unfree;
|
2023-10-09 19:29:22 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
mainProgram = "remnote";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
2024-06-05 15:53:02 +00:00
|
|
|
}
|