@@ -49,6 +49,9 @@
4949, pulseSupport ? stdenv.isLinux
5050, libpulseaudio
5151
52+# For GPU acceleration support on Wayland (without the lib it doesn't seem to work)
53+, libGL
54+
5255# For video acceleration via VA-API (--enable-features=VaapiVideoDecoder,VaapiVideoEncoder)
5356, libvaSupport ? stdenv.isLinux
5457, libva
@@ -66,7 +69,7 @@ let
6669
6770 deps = [
6871 alsa-lib at-spi2-atk at-spi2-core atk cairo cups dbus expat
69− fontconfig freetype gdk-pixbuf glib gtk3 libdrm libX11
72+ fontconfig freetype gdk-pixbuf glib gtk3 libdrm libX11 libGL
7073 libxkbcommon libXScrnSaver libXcomposite libXcursor libXdamage
7174 libXext libXfixes libXi libXrandr libXrender libxshmfence
7275 libXtst libuuid mesa nspr nss pango pipewire udev wayland
@@ -128,9 +131,9 @@ stdenv.mkDerivation rec {
128131 ln -sf $BINARYWRAPPER $out/bin/brave
129132
130133 for exe in $out/opt/brave.com/brave/{brave,chrome_crashpad_handler}; do
131− patchelf \
132− --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
133− --set-rpath "${rpath}" $exe
134+ patchelf \
135+ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
136+ --set-rpath "${rpath}" $exe
134137 done
135138
136139 # Fix paths
@@ -170,10 +173,10 @@ stdenv.mkDerivation rec {
170173 ${optionalString (disableFeatures != []) ''
171174 --add-flags "--disable-features=${strings.concatStringsSep "," disableFeatures}"
172175 ''}
173− --add-flags ${escapeShellArg commandLineArgs}
174176 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}"
175177 ${optionalString vulkanSupport ''
176178 --prefix XDG_DATA_DIRS : "${addOpenGLRunpath.driverLink}/share"
179+ --add-flags ${escapeShellArg commandLineArgs}
177180 ''}
178181 )
179182 '';