From 522731526c17982baa2b7450131fe120d72fef90 Mon Sep 17 00:00:00 2001 From: Gabriel Reynes Date: Sun, 12 Apr 2026 11:55:35 +0200 Subject: [PATCH] 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. --- pkgs/by-name/vi/vivaldi/package.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/vi/vivaldi/package.nix b/pkgs/by-name/vi/vivaldi/package.nix index 60055705301e..f1b333533346 100644 --- a/pkgs/by-name/vi/vivaldi/package.nix +++ b/pkgs/by-name/vi/vivaldi/package.nix @@ -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[@]}