Commit e09ef554 authored by Massimo Gengarelli's avatar Massimo Gengarelli
Browse files

proton-pass: fix login failures caused by missing TLS certificates

When using ASAR, we need to hardcode the path where the assets will be
found, otherwise it won't work.
parent 05466608
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -25,11 +25,12 @@ stdenvNoCC.mkDerivation (finalAttrs: {
    asar
  ];

  # Rebuild the ASAR archive with the assets embedded
  # Rebuild the ASAR archive, hardcoding the resourcesPath
  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
    substituteInPlace tmp/.webpack/main/index.js \
      --replace-fail "process.resourcesPath" "'$out/share/proton-pass'"
    asar pack tmp/ usr/lib/proton-pass/resources/app.asar
    rm -fr tmp
  '';
@@ -38,7 +39,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
    runHook preInstall
    mkdir -p $out/share/proton-pass
    cp -r usr/share/ $out/
    cp -r usr/lib/proton-pass/resources/app.asar $out/share/proton-pass/
    cp -r usr/lib/proton-pass/resources/{app.asar,assets} $out/share/proton-pass/
    runHook postInstall
  '';

@@ -46,6 +47,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
    makeWrapper ${lib.getExe electron} $out/bin/proton-pass \
      --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
  '';