2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, appimageTools, autoPatchelfHook, desktop-file-utils
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchurl, libsecret }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2022-07-18 16:21:45 +00:00
|
|
|
version = "3.23.69";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "standardnotes";
|
|
|
|
name = "${pname}-${version}";
|
2021-12-19 01:06:50 +00:00
|
|
|
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
plat = {
|
2021-12-19 01:06:50 +00:00
|
|
|
i686-linux = "i386";
|
2020-12-09 12:39:15 +00:00
|
|
|
x86_64-linux = "x86_64";
|
2021-12-19 01:06:50 +00:00
|
|
|
}.${stdenv.hostPlatform.system} or throwSystem;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
sha256 = {
|
2022-07-18 16:21:45 +00:00
|
|
|
i686-linux = "sha256-/A2LjV8ky20bcKgs0ijwldryi5VkyROwz49vWYXYQus=";
|
|
|
|
x86_64-linux = "sha256-fA9WH9qUtvAHF9hTFRtxQdpz2dpK0joD0zX9VYBo10g=";
|
2021-12-19 01:06:50 +00:00
|
|
|
}.${stdenv.hostPlatform.system} or throwSystem;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-07-18 16:21:45 +00:00
|
|
|
url = "https://github.com/standardnotes/app/releases/download/%40standardnotes%2Fdesktop%40${version}/standard-notes-${version}-linux-${plat}.AppImage";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
appimageContents = appimageTools.extract {
|
|
|
|
inherit name src;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook desktop-file-utils ];
|
|
|
|
|
|
|
|
in appimageTools.wrapType2 rec {
|
|
|
|
inherit name src;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
extraPkgs = pkgs: with pkgs; [
|
|
|
|
libsecret
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
extraInstallCommands = ''
|
|
|
|
# directory in /nix/store so readonly
|
|
|
|
cd $out
|
|
|
|
chmod -R +w $out
|
|
|
|
mv $out/bin/${name} $out/bin/${pname}
|
|
|
|
|
|
|
|
# fixup and install desktop file
|
|
|
|
${desktop-file-utils}/bin/desktop-file-install --dir $out/share/applications \
|
2022-07-18 16:21:45 +00:00
|
|
|
--set-key Exec --set-value ${pname} ${appimageContents}/standard-notes.desktop
|
|
|
|
ln -s ${appimageContents}/usr/share/icons share
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
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;
|
2021-12-19 01:06:50 +00:00
|
|
|
maintainers = with maintainers; [ mgregoire chuangzhu ];
|
2022-07-18 16:21:45 +00:00
|
|
|
sourceProvenance = [ sourceTypes.binaryNativeCode ];
|
2021-12-19 01:06:50 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|