biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / editors / standardnotes / default.nix
blobe61f57c76448c13f41e69f2380ba445ccbc2c62e
1 { lib
2 , stdenv
3 , fetchurl
4 , dpkg
5 , makeWrapper
6 , electron
7 , desktop-file-utils
8 , callPackage
9 }:
11 let
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;
27   dontConfigure = true;
29   dontBuild = true;
31   nativeBuildInputs = [ makeWrapper dpkg desktop-file-utils ];
33   unpackPhase = "dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner";
35   installPhase = ''
36     runHook preInstall
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
48     runHook postInstall
49   '';
51   passthru.updateScript = callPackage ./update.nix {};
53   meta = with lib; {
54     description = "A simple and private notes app";
55     longDescription = ''
56       Standard Notes is a private notes app that features unmatched simplicity,
57       end-to-end encryption, powerful extensions, and open-source applications.
58     '';
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";
65   };