diff --git a/modules/services/x11/xserver.nix b/modules/services/x11/xserver.nix
index 7cc507feb1d5..c4d74201c961 100644
--- a/modules/services/x11/xserver.nix
+++ b/modules/services/x11/xserver.nix
@@ -225,7 +225,8 @@ in
description = ''
On 64-bit systems, whether to support Direct Rendering for
32-bit applications (such as Wine). This is currently only
- supported for the nvidia driver.
+ supported for the nvidia driver and for
+ mesa.
'';
};
@@ -497,9 +498,12 @@ in
"ln -sf ${kernelPackages.nvidia_x11_legacy304} /run/opengl-driver"
else if elem "ati_unfree" driverNames then
"ln -sf ${kernelPackages.ati_drivers_x11} /run/opengl-driver"
- else if cfg.driSupport then
- "ln -sf ${pkgs.mesa} /run/opengl-driver"
- else ""
+ else
+ ''
+ ${optionalString cfg.driSupport "ln -sf ${pkgs.mesa} /run/opengl-driver"}
+ ${optionalString (pkgs.stdenv.system == "x86_64-linux" && cfg.driSupport32Bit)
+ "ln -sf ${pkgs_i686.mesa} /run/opengl-driver-32"}
+ ''
}
${cfg.displayManager.job.preStart}