nixpkgs/pkgs/applications/misc/todoist-electron/default.nix

52 lines
1.5 KiB
Nix
Raw Normal View History

2021-08-26 17:41:29 +00:00
{ lib, stdenv, fetchurl, appimageTools, makeWrapper, electron, libsecret }:
2020-02-04 00:08:59 +00:00
stdenv.mkDerivation rec {
pname = "todoist-electron";
2021-08-26 17:41:29 +00:00
version = "1.0.1";
2020-02-04 00:08:59 +00:00
src = fetchurl {
url = "https://electron-dl.todoist.com/linux/Todoist-${version}.AppImage";
2021-08-26 17:41:29 +00:00
sha256 = "1c4qmfyfi4hm3fs5bkxjbq1hxs5sgyp531xi5z5vpnzzi5z7dw0k";
2020-02-04 00:08:59 +00:00
};
appimageContents = appimageTools.extractType2 {
name = "${pname}-${version}";
inherit src;
2020-02-04 00:08:59 +00:00
};
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
2020-02-04 00:08:59 +00:00
mkdir -p $out/bin $out/share/${pname} $out/share/applications $out/share/icons/hicolor/512x512
2020-02-04 00:08:59 +00:00
cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
cp -a ${appimageContents}/todoist.desktop $out/share/applications/${pname}.desktop
2021-08-26 17:41:29 +00:00
cp -a ${appimageContents}/usr/share/icons/hicolor/512x512/apps $out/share/icons/hicolor/512x512
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
runHook postInstall
'';
2020-02-04 00:08:59 +00:00
postFixup = ''
2021-08-26 17:41:29 +00:00
makeWrapper ${electron}/bin/electron $out/bin/${pname} \
--add-flags $out/share/${pname}/resources/app.asar \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc libsecret ]}"
2020-02-04 00:08:59 +00:00
'';
meta = with lib; {
homepage = "https://todoist.com";
description = "The official Todoist electron app";
2020-02-04 00:08:59 +00:00
platforms = [ "x86_64-linux" ];
license = licenses.unfree;
maintainers = with maintainers; [ i077 kylesferrazza ];
2020-02-04 00:08:59 +00:00
};
}