Skip to content

Commit

Permalink
proton-pass: fix missing tray icon
Browse files Browse the repository at this point in the history
The Tray Icon pixmaps are not part of the ASAR, it looks like Electron
is expecting to find them into <asar-root-folder>/assets.  This commit
should fix the issue of the Tray Icon not being visible on the DEs
(issue #347830)
  • Loading branch information
massix committed Nov 7, 2024
1 parent 652b22a commit aa3ca21
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions pkgs/by-name/pr/proton-pass/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
dpkg,
makeWrapper,
electron,
asar,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "proton-pass";
Expand All @@ -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
'';
Expand Down

0 comments on commit aa3ca21

Please sign in to comment.