2024-04-21 15:54:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
|
|
|
, dpkg
|
|
|
|
, electron
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
mainProgram = "proton-mail";
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "protonmail-desktop";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.0.2";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/ProtonMail/inbox-desktop/releases/download/v${version}/proton-mail_${version}_amd64.deb";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-c+0iFBpcg+t983oOttPokA5sLGsIQFIsC+GbsVY6hmI=";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ dpkg makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r usr/share/ $out/
|
|
|
|
cp -r usr/lib/proton-mail/resources/app.asar $out/share/
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapper ${lib.getExe electron} $out/bin/${mainProgram} \
|
|
|
|
--add-flags $out/share/app.asar \
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
|
|
|
|
--set-default ELECTRON_FORCE_IS_PACKAGED 1 \
|
|
|
|
--set-default ELECTRON_IS_DEV 0 \
|
|
|
|
--inherit-argv0
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Desktop application for Mail and Calendar, made with Electron";
|
|
|
|
homepage = "https://github.com/ProtonMail/inbox-desktop";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ rsniezek sebtm ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
|
|
|
inherit mainProgram;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|