Merge pull request #245705 from Enzime/fix/vscode-gles

vscode: fix GPU acceleration not working
This commit is contained in:
Pol Dellaiera 2023-07-28 23:16:28 +02:00 committed by GitHub
commit 77a0f8dd16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@
, unzip, libsecret, libXScrnSaver, libxshmfence, buildPackages
, atomEnv, at-spi2-atk, autoPatchelfHook
, systemd, fontconfig, libdbusmenu, glib, buildFHSEnv, wayland
, libglvnd
# Populate passthru.tests
, tests
@ -113,6 +114,9 @@ let
# The credentials should be stored in a secure keychain already, so the benefit of this is questionable
# in the first place.
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
'';
@ -121,6 +125,7 @@ let
gappsWrapperArgs+=(
# Add gio to PATH so that moving files to the trash works when not using a desktop environment
--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 ${lib.escapeShellArg commandLineArgs}
)