vscode: fix GPU acceleration for X

This commit is contained in:
Anil Anar 2023-08-18 01:32:04 +02:00
parent 95adce84aa
commit 1da5d6070c
No known key found for this signature in database

View file

@ -111,9 +111,6 @@ let
# The credentials should be stored in a secure keychain already, so the benefit of this is questionable # The credentials should be stored in a secure keychain already, so the benefit of this is questionable
# in the first place. # in the first place.
rm -rf $out/lib/vscode/resources/app/node_modules/vscode-encrypt rm -rf $out/lib/vscode/resources/app/node_modules/vscode-encrypt
# Unbundle libglvnd as VSCode doesn't include libGLESv2.so.2 which is necessary for GPU acceleration
rm -rf $out/lib/vscode/libGLESv2.so
'') + '' '') + ''
runHook postInstall runHook postInstall
''; '';
@ -122,7 +119,6 @@ let
gappsWrapperArgs+=( gappsWrapperArgs+=(
# Add gio to PATH so that moving files to the trash works when not using a desktop environment # Add gio to PATH so that moving files to the trash works when not using a desktop environment
--prefix PATH : ${glib.bin}/bin --prefix PATH : ${glib.bin}/bin
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libglvnd ]}
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
--add-flags ${lib.escapeShellArg commandLineArgs} --add-flags ${lib.escapeShellArg commandLineArgs}
) )
@ -157,6 +153,10 @@ let
chmod +x ${vscodeRipgrep} chmod +x ${vscodeRipgrep}
''); '');
postFixup = lib.optionalString stdenv.isLinux ''
patchelf --add-needed ${libglvnd}/lib/libGLESv2.so.2 $out/lib/vscode/${executableName}
'';
inherit meta; inherit meta;
}; };