vivaldi: fix Vulkan ICD discovery

Vivaldi ships its own libvulkan.so.1 which does not know about the
NixOS-specific /run/opengl-driver/share search path, preventing
Vulkan ICD discovery. This causes WebGPU's requestAdapter() to
return null.

Replace the bundled libvulkan.so.1 with a symlink to the NixOS-patched
vulkan-loader and add addDriverRunpath.driverLink/share to XDG_DATA_DIRS,
matching the approach used by google-chrome and microsoft-edge.
This commit is contained in:
Gabriel Reynes
2026-04-12 11:55:35 +02:00
parent 8762f4bc0c
commit 522731526c
+6 -1
View File
@@ -47,6 +47,7 @@
libdrm,
libgbm,
vulkan-loader,
addDriverRunpath,
nss,
nspr,
patchelf,
@@ -208,9 +209,13 @@ stdenv.mkDerivation rec {
"$out"/opt/vivaldi/product_logo_''${d}.png \
"$out"/share/icons/hicolor/''${d}x''${d}/apps/vivaldi.png
done
# replace bundled vulkan-loader with the NixOS-patched one to enable Vulkan ICD discovery
rm $out/opt/vivaldi/libvulkan.so.1
ln -s "${lib.getLib vulkan-loader}/lib/libvulkan.so.1" $out/opt/vivaldi/libvulkan.so.1
wrapProgram "$out/bin/vivaldi" \
--add-flags ${lib.escapeShellArg commandLineArgs} \
--prefix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/ \
--prefix XDG_DATA_DIRS : "${addDriverRunpath.driverLink}/share:${gtk3}/share/gsettings-schemas/${gtk3.name}" \
--prefix LD_LIBRARY_PATH : ${libPath} \
--prefix PATH : ${coreutils}/bin \
''${qtWrapperArgs[@]}