2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, appimageTools, autoPatchelfHook, desktop-file-utils
|
2021-02-27 15:58:33 +01:00
|
|
|
, fetchurl, libsecret, gtk3, gsettings-desktop-schemas }:
|
2018-10-28 22:31:18 +01:00
|
|
|
|
|
|
|
let
|
2021-08-16 13:59:21 +02:00
|
|
|
version = "3.8.18";
|
2020-03-05 11:23:11 +01:00
|
|
|
pname = "standardnotes";
|
|
|
|
name = "${pname}-${version}";
|
2018-10-28 22:31:18 +01:00
|
|
|
|
|
|
|
plat = {
|
2021-08-16 13:59:21 +02:00
|
|
|
i386-linux = "i386";
|
2020-12-08 23:32:28 +01:00
|
|
|
x86_64-linux = "x86_64";
|
2018-10-28 22:31:18 +01:00
|
|
|
}.${stdenv.hostPlatform.system};
|
|
|
|
|
|
|
|
sha256 = {
|
2021-08-16 13:59:21 +02:00
|
|
|
i386-linux = "1xiypsmvpk8i6kab862pipbdfb0y5d5355hdwjmva7v7g26aa7h7";
|
|
|
|
x86_64-linux = "03qlxlgyypnvcr40jh6i4wriyax2jbfhrb798cq0n7qlc1y4pg8r";
|
2018-10-28 22:31:18 +01:00
|
|
|
}.${stdenv.hostPlatform.system};
|
|
|
|
|
|
|
|
src = fetchurl {
|
2020-12-08 23:32:28 +01:00
|
|
|
url = "https://github.com/standardnotes/desktop/releases/download/v${version}/standard-notes-${version}-linux-${plat}.AppImage";
|
2018-10-28 22:31:18 +01:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2020-03-05 11:23:11 +01:00
|
|
|
appimageContents = appimageTools.extract {
|
|
|
|
inherit name src;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook desktop-file-utils ];
|
|
|
|
|
|
|
|
in appimageTools.wrapType2 rec {
|
|
|
|
inherit name src;
|
|
|
|
|
2021-01-25 15:25:49 +01:00
|
|
|
profile = ''
|
|
|
|
export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS
|
|
|
|
'';
|
|
|
|
|
|
|
|
extraPkgs = pkgs: with pkgs; [
|
|
|
|
libsecret
|
|
|
|
];
|
|
|
|
|
2020-03-05 11:23:11 +01:00
|
|
|
extraInstallCommands = ''
|
|
|
|
# directory in /nix/store so readonly
|
|
|
|
cp -r ${appimageContents}/* $out
|
|
|
|
cd $out
|
|
|
|
chmod -R +w $out
|
|
|
|
mv $out/bin/${name} $out/bin/${pname}
|
2018-10-28 22:31:18 +01:00
|
|
|
|
2020-03-05 11:23:11 +01:00
|
|
|
# fixup and install desktop file
|
|
|
|
${desktop-file-utils}/bin/desktop-file-install --dir $out/share/applications \
|
|
|
|
--set-key Exec --set-value ${pname} standard-notes.desktop
|
2018-10-28 22:31:18 +01:00
|
|
|
|
2020-03-05 11:23:11 +01:00
|
|
|
rm usr/lib/* AppRun standard-notes.desktop .so*
|
2018-10-28 22:31:18 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2018-10-28 22:31:18 +01: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.
|
|
|
|
'';
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://standardnotes.org";
|
2018-10-28 22:31:18 +01:00
|
|
|
license = licenses.agpl3;
|
|
|
|
maintainers = with maintainers; [ mgregoire ];
|
|
|
|
platforms = [ "i386-linux" "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|