os/overlays/signal-desktop.nix

26 lines
1.2 KiB
Nix

final: prev: {
signal-desktop = prev.signal-desktop.overrideAttrs (oldAttrs: rec {
inherit (oldAttrs) pname;
version = "6.38.0";
hash = "sha256-y2mwO7Qc01vuIeJUcAxYDD97DXOwXCd8wNZmkG4maF0=";
dir = "Signal";
src = prev.fetchurl {
url = "https://updates.signal.org/desktop/apt/pool/s/${pname}/${pname}_${version}_amd64.deb";
inherit hash;
};
preFixup = ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : "${prev.lib.makeLibraryPath [prev.stdenv.cc.cc prev.pipewire]}"
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-features=UseOzonePlatform --ozone-platform=wayland}}"
--suffix PATH : ${prev.lib.makeBinPath [prev.xdg-utils]}
)
# Fix the desktop link
substituteInPlace $out/share/applications/${pname}.desktop \
--replace "/opt/${dir}/${pname}" $out/bin/${pname}
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"
'';
});
}