2023-07-15 17:15:38 +00:00
|
|
|
{ lib, stdenv, fetchurl, dpkg, makeWrapper, electron, libsecret
|
|
|
|
, desktop-file-utils , callPackage }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
srcjson = builtins.fromJSON (builtins.readFile ./src.json);
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
pname = "standardnotes";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchurl (srcjson.deb.${stdenv.hostPlatform.system} or throwSystem);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
inherit (srcjson) version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
dontConfigure = true;
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper dpkg desktop-file-utils ];
|
|
|
|
|
|
|
|
unpackPhase = "dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin $out/share/standardnotes
|
|
|
|
cp -R usr/share/{applications,icons} $out/share
|
|
|
|
cp -R opt/Standard\ Notes/resources/app.asar $out/share/standardnotes/
|
|
|
|
|
|
|
|
makeWrapper ${electron}/bin/electron $out/bin/standardnotes \
|
|
|
|
--add-flags $out/share/standardnotes/app.asar \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libsecret stdenv.cc.cc.lib ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
${desktop-file-utils}/bin/desktop-file-install --dir $out/share/applications \
|
2023-07-15 17:15:38 +00:00
|
|
|
--set-key Exec --set-value standardnotes usr/share/applications/standard-notes.desktop
|
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
passthru.updateScript = callPackage ./update.nix {};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A simple and private notes app";
|
|
|
|
longDescription = ''
|
|
|
|
Standard Notes is a private notes app that features unmatched simplicity,
|
|
|
|
end-to-end encryption, powerful extensions, and open-source applications.
|
|
|
|
'';
|
|
|
|
homepage = "https://standardnotes.org";
|
|
|
|
license = licenses.agpl3;
|
2023-01-20 10:41:00 +00:00
|
|
|
maintainers = with maintainers; [ mgregoire chuangzhu squalus ];
|
2022-07-18 16:21:45 +00:00
|
|
|
sourceProvenance = [ sourceTypes.binaryNativeCode ];
|
2023-07-15 17:15:38 +00:00
|
|
|
platforms = builtins.attrNames srcjson.deb;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "standardnotes";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|