From aa3ca218252d482d3e0951192237bd5f1808f6e1 Mon Sep 17 00:00:00 2001 From: Massimo Gengarelli Date: Thu, 7 Nov 2024 10:47:00 +0100 Subject: [PATCH] proton-pass: fix missing tray icon The Tray Icon pixmaps are not part of the ASAR, it looks like Electron is expecting to find them into /assets. This commit should fix the issue of the Tray Icon not being visible on the DEs (issue #347830) --- pkgs/by-name/pr/proton-pass/package.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/pr/proton-pass/package.nix b/pkgs/by-name/pr/proton-pass/package.nix index 5545ab8a94f2a..82ab6501009e3 100644 --- a/pkgs/by-name/pr/proton-pass/package.nix +++ b/pkgs/by-name/pr/proton-pass/package.nix @@ -5,6 +5,7 @@ dpkg, makeWrapper, electron, + asar, }: stdenvNoCC.mkDerivation (finalAttrs: { pname = "proton-pass"; @@ -21,21 +22,30 @@ stdenvNoCC.mkDerivation (finalAttrs: { nativeBuildInputs = [ dpkg makeWrapper + asar ]; + # Rebuild the ASAR archive with the assets embedded + preInstall = '' + asar extract usr/lib/proton-pass/resources/app.asar tmp + cp -r usr/lib/proton-pass/resources/assets/ tmp/ + rm usr/lib/proton-pass/resources/app.asar + asar pack tmp/ usr/lib/proton-pass/resources/app.asar + rm -fr tmp + ''; + installPhase = '' runHook preInstall - mkdir -p $out + mkdir -p $out/share/proton-pass cp -r usr/share/ $out/ - cp -r usr/lib/proton-pass/resources/app.asar $out/share/ + cp -r usr/lib/proton-pass/resources/app.asar $out/share/proton-pass/ runHook postInstall ''; preFixup = '' makeWrapper ${lib.getExe electron} $out/bin/proton-pass \ - --add-flags $out/share/app.asar \ + --add-flags $out/share/proton-pass/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 '';