Rename hardware.opengl.videoDrivers back to services.xserver.videoDrivers

Fixes #2379.
The new name was a misnomer because the values really are X11 video
drivers (e.g. ‘cirrus’ or ‘nvidia’), not OpenGL implementations. That
it's also used to set an OpenGL implementation for kmscon is just
confusing overloading.

Changed files
+49 -40
nixos
+2 -2
nixos/doc/manual/configuration.xml
···
and <literal>intel</literal>). You can also specify a driver
manually, e.g.
<programlisting>
-
hardware.opengl.videoDrivers = [ "r128" ];
+
services.xserver.videoDrivers = [ "r128" ];
</programlisting>
to enable X.org’s <literal>xf86-video-r128</literal> driver.</para>
···
has better 3D performance than the X.org drivers. It is not enabled
by default because it’s not free software. You can enable it as follows:
<programlisting>
-
hardware.opengl.videoDrivers = [ "nvidia" ];
+
services.xserver.videoDrivers = [ "nvidia" ];
</programlisting>
You may need to reboot after enabling this driver to prevent a clash
with other kernel modules.</para>
+24 -28
nixos/modules/hardware/opengl.nix
···
-
{ config, pkgs, pkgs_i686, ... }:
+
{ config, lib, pkgs, pkgs_i686, ... }:
+
+
with lib;
+
let
-
inherit (pkgs.lib) mkOption types mkIf optional optionals elem optionalString optionalAttrs;
cfg = config.hardware.opengl;
kernelPackages = config.boot.kernelPackages;
-
in {
+
+
videoDrivers = config.services.xserver.videoDrivers;
+
+
in
+
+
{
options = {
hardware.opengl.enable = mkOption {
-
description = "Whether this configuration requires opengl.";
+
description = "Whether this configuration requires OpenGL.";
type = types.bool;
default = false;
internal = true;
···
'';
};
-
-
hardware.opengl.videoDrivers = mkOption {
-
type = types.listOf types.str;
-
# !!! We'd like "nv" here, but it segfaults the X server.
-
default = [ "ati" "cirrus" "intel" "vesa" "vmware" ];
-
example = [ "vesa" ];
-
description = ''
-
The names of the opengl video drivers the configuration
-
supports. They will be tried in order until one that
-
supports your card is found.
-
'';
-
};
};
config = mkIf cfg.enable {
···
${optionalString (pkgs.stdenv.isi686) "ln -sf opengl-driver /run/opengl-driver-32"}
''
#TODO: The OpenGL driver should depend on what's detected at runtime.
-
+( if elem "nvidia" cfg.videoDrivers then
+
+( if elem "nvidia" videoDrivers then
''
ln -sf ${kernelPackages.nvidia_x11} /run/opengl-driver
${optionalString cfg.driSupport32Bit
"ln -sf ${pkgs_i686.linuxPackages.nvidia_x11.override { libsOnly = true; kernel = null; } } /run/opengl-driver-32"}
''
-
else if elem "nvidiaLegacy173" cfg.videoDrivers then
+
else if elem "nvidiaLegacy173" videoDrivers then
"ln -sf ${kernelPackages.nvidia_x11_legacy173} /run/opengl-driver"
-
else if elem "nvidiaLegacy304" cfg.videoDrivers then
+
else if elem "nvidiaLegacy304" videoDrivers then
''
ln -sf ${kernelPackages.nvidia_x11_legacy304} /run/opengl-driver
${optionalString cfg.driSupport32Bit
"ln -sf ${pkgs_i686.linuxPackages.nvidia_x11_legacy304.override { libsOnly = true; kernel = null; } } /run/opengl-driver-32"}
''
-
else if elem "ati_unfree" cfg.videoDrivers then
+
else if elem "ati_unfree" videoDrivers then
"ln -sf ${kernelPackages.ati_drivers_x11} /run/opengl-driver"
else
let
···
[ "/run/opengl-driver/lib" "/run/opengl-driver-32/lib" ];
boot.extraModulePackages =
-
optional (elem "nvidia" cfg.videoDrivers) kernelPackages.nvidia_x11 ++
-
optional (elem "nvidiaLegacy173" cfg.videoDrivers) kernelPackages.nvidia_x11_legacy173 ++
-
optional (elem "nvidiaLegacy304" cfg.videoDrivers) kernelPackages.nvidia_x11_legacy304 ++
-
optional (elem "virtualbox" cfg.videoDrivers) kernelPackages.virtualboxGuestAdditions ++
-
optional (elem "ati_unfree" cfg.videoDrivers) kernelPackages.ati_drivers_x11;
+
optional (elem "nvidia" videoDrivers) kernelPackages.nvidia_x11 ++
+
optional (elem "nvidiaLegacy173" videoDrivers) kernelPackages.nvidia_x11_legacy173 ++
+
optional (elem "nvidiaLegacy304" videoDrivers) kernelPackages.nvidia_x11_legacy304 ++
+
optional (elem "virtualbox" videoDrivers) kernelPackages.virtualboxGuestAdditions ++
+
optional (elem "ati_unfree" videoDrivers) kernelPackages.ati_drivers_x11;
boot.blacklistedKernelModules =
-
optionals (elem "nvidia" cfg.videoDrivers) [ "nouveau" "nvidiafb" ];
+
optionals (elem "nvidia" videoDrivers) [ "nouveau" "nvidiafb" ];
-
environment.etc = (optionalAttrs (elem "ati_unfree" cfg.videoDrivers) {
+
environment.etc =
+
(optionalAttrs (elem "ati_unfree" videoDrivers) {
"ati".source = "${kernelPackages.ati_drivers_x11}/etc/ati";
})
-
// (optionalAttrs (elem "nvidia" cfg.videoDrivers) {
+
// (optionalAttrs (elem "nvidia" videoDrivers) {
"OpenCL/vendors/nvidia.icd".source = "${kernelPackages.nvidia_x11}/lib/vendors/nvidia.icd";
});
};
+2 -1
nixos/modules/installer/cd-dvd/system-tarball-sheevaplug.nix
···
};
# Setting vesa, we don't get the nvidia driver, which can't work in arm.
-
hardware.opengl.videoDrivers = [ "vesa" ];
+
services.xserver.videoDrivers = [ "vesa" ];
+
services.nixosManual.enable = false;
# Include the firmware for various wireless cards.
+1 -1
nixos/modules/installer/tools/nixos-generate-config.pl
···
pciCheck $path;
}
-
push @attrs, "hardware.opengl.videoDrivers = [ \"$videoDriver\" ];" if $videoDriver;
+
push @attrs, "services.xserver.videoDrivers = [ \"$videoDriver\" ];" if $videoDriver;
# Idem for USB devices.
+1 -1
nixos/modules/installer/virtualbox-demo.nix
···
# Add some more video drivers to give X11 a shot at working in
# VMware and QEMU.
-
hardware.opengl.videoDrivers = mkOverride 40 [ "virtualbox" "vmware" "cirrus" "vesa" ];
+
services.xserver.videoDrivers = mkOverride 40 [ "virtualbox" "vmware" "cirrus" "vesa" ];
}
+1 -1
nixos/modules/rename.nix
···
++ obsolete [ "services" "xserver" "driSupport" ] [ "hardware" "opengl" "driSupport" ]
++ obsolete [ "services" "xserver" "driSupport32Bit" ] [ "hardware" "opengl" "driSupport32Bit" ]
++ obsolete [ "services" "xserver" "s3tcSupport" ] [ "hardware" "opengl" "s3tcSupport" ]
-
++ obsolete [ "services" "xserver" "videoDrivers" ] [ "hardware" "opengl" "videoDrivers" ]
+
++ obsolete [ "hardware" "opengl" "videoDrivers" ] [ "services" "xserver" "videoDrivers" ]
++ obsolete [ "services" "mysql55" ] [ "services" "mysql" ]
+1 -1
nixos/modules/services/x11/terminal-server.nix
···
config = {
services.xserver.enable = true;
-
hardware.opengl.videoDrivers = [];
+
services.xserver.videoDrivers = [];
# Enable KDM. Any display manager will do as long as it supports XDMCP.
services.xserver.displayManager.kdm.enable = true;
+15 -3
nixos/modules/services/x11/xserver.nix
···
intel-testing = { modules = with pkgs.xorg; [ xf86videointel-testing glamoregl ]; driverName = "intel"; };
};
-
driverNames = config.hardware.opengl.videoDrivers;
+
driverNames = cfg.videoDrivers;
needsAcpid =
(elem "nvidia" driverNames) ||
···
'';
};
+
videoDrivers = mkOption {
+
type = types.listOf types.str;
+
# !!! We'd like "nv" here, but it segfaults the X server.
+
default = [ "ati" "cirrus" "intel" "vesa" "vmware" ];
+
example = [ "vesa" ];
+
description = ''
+
The names of the video drivers the configuration
+
supports. They will be tried in order until one that
+
supports your card is found.
+
'';
+
};
+
videoDriver = mkOption {
type = types.nullOr types.str;
default = null;
···
description = ''
The name of the video driver for your graphics card. This
option is obsolete; please set the
-
<option>hardware.opengl.videoDrivers</option> instead.
+
<option>services.xserver.videoDrivers</option> instead.
'';
};
···
config = mkIf cfg.enable {
hardware.opengl.enable = true;
-
hardware.opengl.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
+
services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
assertions =
[ { assertion = !(config.programs.ssh.startAgent && cfg.startGnuPGAgent);
+1 -1
nixos/modules/virtualisation/qemu-vm.nix
···
# When building a regular system configuration, override whatever
# video driver the host uses.
-
hardware.opengl.videoDrivers = mkVMOverride [ "vesa" ];
+
services.xserver.videoDrivers = mkVMOverride [ "vesa" ];
services.xserver.defaultDepth = mkVMOverride 0;
services.xserver.resolutions = mkVMOverride [ { x = 1024; y = 768; } ];
services.xserver.monitorSection =
+1 -1
nixos/modules/virtualisation/virtualbox-guest.nix
···
serviceConfig.ExecStart = "@${kernel.virtualboxGuestAdditions}/sbin/VBoxService VBoxService --foreground";
};
-
hardware.opengl.videoDrivers = mkOverride 50 [ "virtualbox" ];
+
services.xserver.videoDrivers = mkOverride 50 [ "virtualbox" ];
services.xserver.config =
''