2023-05-31 18:57:52 +00:00
|
|
|
final: prev: {
|
|
|
|
signal-desktop = prev.signal-desktop.overrideAttrs (oldAttrs: rec {
|
2023-07-02 11:13:40 +00:00
|
|
|
inherit (oldAttrs) pname;
|
2023-05-31 18:57:52 +00:00
|
|
|
dir = "Signal";
|
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
2023-11-20 17:43:39 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${prev.lib.makeLibraryPath [ prev.stdenv.cc.cc prev.pipewire ] }"
|
|
|
|
# Currently crashes see https://github.com/NixOS/nixpkgs/issues/222043
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
|
|
|
|
--suffix PATH : ${prev.lib.makeBinPath [ prev.xdg-utils ]}
|
2023-05-31 18:57:52 +00:00
|
|
|
)
|
2023-11-20 17:43:39 +00:00
|
|
|
|
|
|
|
# Fix the desktop link and fix showing application icon in tray
|
2023-05-31 18:57:52 +00:00
|
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
2023-11-20 17:43:39 +00:00
|
|
|
--replace "/opt/${dir}/${pname}" $out/bin/${pname} \
|
|
|
|
${if pname == "signal-desktop" then "--replace \"bin/signal-desktop\" \"bin/signal-desktop --use-tray-icon\"" else ""}
|
|
|
|
|
2023-05-31 18:57:52 +00:00
|
|
|
autoPatchelf --no-recurse -- "$out/lib/${dir}/"
|
|
|
|
patchelf --add-needed ${prev.libpulseaudio}/lib/libpulse.so "$out/lib/${dir}/resources/app.asar.unpacked/node_modules/@signalapp/ringrtc/build/linux/libringrtc-x64.node"
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
}
|