fix: make element and signal work with wayland

This commit is contained in:
Benjamin Bädorf 2024-01-24 21:05:09 +01:00
parent 08f77c4641
commit d573f60ddd
No known key found for this signature in database
GPG key ID: 1B7BF5B77A521346
3 changed files with 4 additions and 20 deletions

View file

@ -39,7 +39,7 @@
(import ./blesh.nix)
(import ./rnix-lsp.nix)
(import ./neovim-plugins.nix)
(import ./signal-desktop.nix)
(import ./element-desktop.nix)
];
});
};

View file

@ -0,0 +1,3 @@
final: prev: {
element-desktop = prev.element-desktop.override { electron = prev.electron_28; };
}

View file

@ -1,19 +0,0 @@
final: prev: {
signal-desktop = prev.signal-desktop.overrideAttrs (oldAttrs: rec {
inherit (oldAttrs) pname;
dir = "Signal";
preFixup = ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : "${prev.lib.makeLibraryPath [prev.stdenv.cc.cc]}"
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
--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"
'';
});
}