13 srcjson = builtins.fromJSON (builtins.readFile ./src.json);
15 throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
19 stdenv.mkDerivation rec {
21 pname = "standardnotes";
23 src = fetchurl (srcjson.deb.${stdenv.hostPlatform.system} or throwSystem);
25 inherit (srcjson) version;
31 nativeBuildInputs = [ makeWrapper dpkg desktop-file-utils ];
33 unpackPhase = "dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner";
38 mkdir -p $out/bin $out/share/standardnotes
39 cp -R usr/share/{applications,icons} $out/share
40 cp -R opt/Standard\ Notes/resources/app.asar $out/share/standardnotes/
42 makeWrapper ${electron}/bin/electron $out/bin/standardnotes \
43 --add-flags $out/share/standardnotes/app.asar
45 ${desktop-file-utils}/bin/desktop-file-install --dir $out/share/applications \
46 --set-key Exec --set-value standardnotes usr/share/applications/standard-notes.desktop
51 passthru.updateScript = callPackage ./update.nix {};
54 description = "A simple and private notes app";
56 Standard Notes is a private notes app that features unmatched simplicity,
57 end-to-end encryption, powerful extensions, and open-source applications.
59 homepage = "https://standardnotes.org";
60 license = licenses.agpl3Only;
61 maintainers = with maintainers; [ mgregoire chuangzhu squalus ];
62 sourceProvenance = [ sourceTypes.binaryNativeCode ];
63 platforms = builtins.attrNames srcjson.deb;
64 mainProgram = "standardnotes";