diff options
author | Radoslaw Sniezek <radoslaw.sniezek@proton.me> | 2024-03-18 10:29:29 +0100 |
---|---|---|
committer | Radoslaw Sniezek <radoslaw.sniezek@proton.me> | 2024-03-28 11:17:51 +0100 |
commit | 2d76120d0cbce879cb330790ceb24c7ac91117ab (patch) | |
tree | 4fc1a808bfa6305867332a03d6b89911b1de1113 /pkgs/by-name/pr | |
parent | 0b2e86386fc22fbc0f612a914ecf9d820c3a3b22 (diff) |
protonmail-desktop: init at 1.0.1
Add package for proton mail desktop app in the beta version. Apply suggestions from code review Apply batch of suggestions from CR by @dotlambda. Co-authored-by: Robert Schütz <github@dotlambda.de>
Diffstat (limited to 'pkgs/by-name/pr')
-rw-r--r-- | pkgs/by-name/pr/protonmail-desktop/package.nix | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/by-name/pr/protonmail-desktop/package.nix b/pkgs/by-name/pr/protonmail-desktop/package.nix new file mode 100644 index 0000000000000..b3edfaa9dc212 --- /dev/null +++ b/pkgs/by-name/pr/protonmail-desktop/package.nix @@ -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; + }; +} + |