This is the relevant issue: Vulkan disabled in chromium: Couldn't open libvulkan.so.1 · Issue #150398 · NixOS/nixpkgs · GitHub
Apparently this commit might help, but I have no idea about chromium builds: chromium: Install libvulkan.so.1 · a-m-joseph/nixpkgs@b7fe2da · GitHub. You could do the same in an overlay like this:
final: prev: {
chromium = prev.chromium.overrideAttrs(old: {
postInstall = ''
cp -v "$buildPath/libvulkan.so.1" "$libExecPath/"
'';
});
}
Though it looks like that’s already being done upstream in 22.05, so upgrade if you haven’t yet: nixpkgs/browser.nix at 21321a6381fd8d3660fe1cdc0485fbb5978112ce · NixOS/nixpkgs · GitHub
To apply your hack permanently to the chromium package, I think you would use an overlay like this:
final: prev: {
chromium = prev.chromium.overrideAttrs(old: {
postInstall = ''
wrapProgram $out/bin/chromium \
--prefix LD_LIBRARY_PATH : "${prev.makeLibraryPath [prev.vulkan-loader]}"
'';
});
}
This will mean you need to rebuild the chromium package though
Might be better to create a separate derivation that just depends on the chromium one, and is just a little shell script that sets the library path. Perhaps:
final: prev: {
chromium = prev.writeShellScriptBin "chromium" ''
LD_LIBRARY_PATH="${prev.makeLibraryPath [prev.vulkan-loader]}:$LD_LIBRARY_PATH" ${prev.chromium}/bin/chromium $@
'';
}
Edit: Shout if any of these work, would probably be nice to add them to the upstream ticket.