diff --git a/pkgs/build-support/opengl/mesa-switch.sh b/pkgs/build-support/opengl/mesa-switch.sh index 8dcabc07dea..59a316d8af0 100644 --- a/pkgs/build-support/opengl/mesa-switch.sh +++ b/pkgs/build-support/opengl/mesa-switch.sh @@ -6,6 +6,10 @@ if test -z "$OPENGL_DRIVER"; then if test -d "$profile/lib"; then OPENGL_DRIVER=$profile fi + # OpenGL driver for current X server on NixOS. + if test -d /var/state/opengl-driver; then + OPENGL_DRIVER=/var/state/opengl-driver + fi fi if test -z "$OPENGL_DRIVER"; then