1 { lib, stdenv, appimageTools, fetchurl, undmg }:
7 inherit (stdenv.hostPlatform) system;
8 throwSystem = throw "Unsupported system: ${system}";
11 x86_64-linux = "linux_x86_64.AppImage";
12 x86_64-darwin = "mac_x64.dmg";
13 aarch64-darwin = "mac_arm64.dmg";
14 }.${system} or throwSystem;
17 url = "https://github.com/streetwriters/notesnook/releases/download/v${version}/notesnook_${suffix}";
19 x86_64-linux = "sha256-PLHP1Q4+xcHyr0323K4BD+oH57SspsrAcxRe/C6RFDU=";
20 x86_64-darwin = "sha256-gOUL3qLSM+/pr519Gc0baUtbmhA40lG6XzuCRyGILkc=";
21 aarch64-darwin = "sha256-d1nXdCv1mK4+4Gef1upIkHS3J2d9qzTLXbBWabsJwpw=";
22 }.${system} or throwSystem;
25 appimageContents = appimageTools.extractType2 {
26 inherit pname version src;
30 description = "A fully open source & end-to-end encrypted note taking alternative to Evernote.";
32 Notesnook is a free (as in speech) & open source note taking app
33 focused on user privacy & ease of use. To ensure zero knowledge
34 principles, Notesnook encrypts everything on your device using
35 XChaCha20-Poly1305 & Argon2.
37 homepage = "https://notesnook.com";
38 license = licenses.gpl3Only;
39 maintainers = with maintainers; [ j0lol ];
40 platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
43 linux = appimageTools.wrapType2 rec {
44 inherit pname version src meta;
50 multiPkgs = null; # no 32bit needed
51 extraPkgs = appimageTools.defaultFhsEnvArgs.multiPkgs;
52 extraInstallCommands = ''
53 mv $out/bin/{${pname}-${version},${pname}}
54 install -Dm444 ${appimageContents}/notesnook.desktop -t $out/share/applications
55 install -Dm444 ${appimageContents}/notesnook.png -t $out/share/pixmaps
56 substituteInPlace $out/share/applications/notesnook.desktop \
57 --replace 'Exec=AppRun --no-sandbox %U' 'Exec=${pname}'
61 darwin = stdenv.mkDerivation {
62 inherit pname version src meta;
64 nativeBuildInputs = [ undmg ];
66 sourceRoot = "Notesnook.app";
69 mkdir -p $out/Applications/Notesnook.app
70 cp -R . $out/Applications/Notesnook.app