2023-07-15 17:15:38 +00:00
|
|
|
{ lib, stdenv, fetchurl, appimageTools, makeWrapper, electron_24, libsecret }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "todoist-electron";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "8.3.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-07-15 17:15:38 +00:00
|
|
|
url = "https://electron-dl.todoist.com/linux/Todoist-linux-x86_64-${version}.AppImage";
|
|
|
|
hash = "sha256-X928hCrYVOBTEZq1hmZWgWlabtOzQrLUuptF/SJcAto=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
appimageContents = appimageTools.extractType2 {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
inherit src;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
dontUnpack = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
mkdir -p $out/bin $out/share/${pname} $out/share/applications $out/share/icons/hicolor/512x512
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
|
|
|
|
cp -a ${appimageContents}/todoist.desktop $out/share/applications/${pname}.desktop
|
2021-10-04 12:37:57 +00:00
|
|
|
cp -a ${appimageContents}/usr/share/icons/hicolor/512x512/apps $out/share/icons/hicolor/512x512
|
2021-02-19 19:06:45 +00:00
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
|
|
|
--replace 'Exec=AppRun' 'Exec=${pname}'
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
postFixup = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
makeWrapper ${electron_24}/bin/electron $out/bin/todoist-electron \
|
2021-02-19 19:06:45 +00:00
|
|
|
--add-flags $out/share/${pname}/resources/app.asar \
|
2023-02-02 18:25:31 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc libsecret ]}" \
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-02-19 19:06:45 +00:00
|
|
|
homepage = "https://todoist.com";
|
|
|
|
description = "The official Todoist electron app";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2021-02-19 19:06:45 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ i077 kylesferrazza ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|