@@ -49,6 +49,9 @@
49, pulseSupport ? stdenv.isLinux
49, pulseSupport ? stdenv.isLinux
50, libpulseaudio
50, libpulseaudio
52+# For GPU acceleration support on Wayland (without the lib it doesn't seem to work)
52# For video acceleration via VA-API (--enable-features=VaapiVideoDecoder,VaapiVideoEncoder)
55# For video acceleration via VA-API (--enable-features=VaapiVideoDecoder,VaapiVideoEncoder)
53, libvaSupport ? stdenv.isLinux
56, libvaSupport ? stdenv.isLinux
@@ -66,7 +69,7 @@ let
68 alsa-lib at-spi2-atk at-spi2-core atk cairo cups dbus expat
71 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
70 libxkbcommon libXScrnSaver libXcomposite libXcursor libXdamage
73 libxkbcommon libXScrnSaver libXcomposite libXcursor libXdamage
71 libXext libXfixes libXi libXrandr libXrender libxshmfence
74 libXext libXfixes libXi libXrandr libXrender libxshmfence
72 libXtst libuuid mesa nspr nss pango pipewire udev wayland
75 libXtst libuuid mesa nspr nss pango pipewire udev wayland
@@ -128,9 +131,9 @@ stdenv.mkDerivation rec {
128 ln -sf $BINARYWRAPPER $out/bin/brave
131 ln -sf $BINARYWRAPPER $out/bin/brave
130 for exe in $out/opt/brave.com/brave/{brave,chrome_crashpad_handler}; do
133 for exe in $out/opt/brave.com/brave/{brave,chrome_crashpad_handler}; do
131− patchelf \
134+ patchelf \
132− --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
135+ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
133− --set-rpath "${rpath}" $exe
136+ --set-rpath "${rpath}" $exe
136 # Fix paths
139 # Fix paths
@@ -170,10 +173,10 @@ stdenv.mkDerivation rec {
170 ${optionalString (disableFeatures != []) ''
173 ${optionalString (disableFeatures != []) ''
171 --add-flags "--disable-features=${strings.concatStringsSep "," disableFeatures}"
174 --add-flags "--disable-features=${strings.concatStringsSep "," disableFeatures}"
173− --add-flags ${escapeShellArg commandLineArgs}
174 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}"
176 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}"
175 ${optionalString vulkanSupport ''
177 ${optionalString vulkanSupport ''
176 --prefix XDG_DATA_DIRS : "${addOpenGLRunpath.driverLink}/share"
178 --prefix XDG_DATA_DIRS : "${addOpenGLRunpath.driverLink}/share"
179+ --add-flags ${escapeShellArg commandLineArgs}