Merge pull request #296127 from rsniezek/protonmail

protonmail-desktop: init at 1.0.1
This commit is contained in:
Weijia Wang 2024-03-28 13:07:38 +01:00 committed by GitHub
commit 6fcde47b4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 58 additions and 0 deletions

View file

@ -17025,6 +17025,12 @@
github = "rski";
githubId = 2960312;
};
rsniezek = {
email = "radoslaw.sniezek@protonmail.com";
github = "rsniezek";
githubId = 19433256;
name = "Radoslaw Sniezek";
};
rsynnest = {
email = "contact@rsynnest.com";
github = "rsynnest";

View file

@ -0,0 +1,52 @@
{ lib
, stdenv
, fetchurl
, makeWrapper
, dpkg
, electron
}:
let
mainProgram = "proton-mail";
in stdenv.mkDerivation rec {
pname = "protonmail-desktop";
version = "1.0.1";
src = fetchurl {
url = "https://github.com/ProtonMail/inbox-desktop/releases/download/v${version}/proton-mail_${version}_amd64.deb";
hash = "sha256-fNK//x3DOsynWSkG9N+nZ3wjYoC+RreaYVC6KEDXh4w=";
};
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;
};
}