forked from mirrors/nixpkgs
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.
This commit is contained in:
parent
e6b5c0121f
commit
3fe96bcca1
nixos
|
@ -1195,7 +1195,7 @@ driver from a set of X.org drivers (such as <literal>vesa</literal>
|
||||||
and <literal>intel</literal>). You can also specify a driver
|
and <literal>intel</literal>). You can also specify a driver
|
||||||
manually, e.g.
|
manually, e.g.
|
||||||
<programlisting>
|
<programlisting>
|
||||||
hardware.opengl.videoDrivers = [ "r128" ];
|
services.xserver.videoDrivers = [ "r128" ];
|
||||||
</programlisting>
|
</programlisting>
|
||||||
to enable X.org’s <literal>xf86-video-r128</literal> driver.</para>
|
to enable X.org’s <literal>xf86-video-r128</literal> driver.</para>
|
||||||
|
|
||||||
|
@ -1238,7 +1238,7 @@ $ systemctl start display-manager.service
|
||||||
has better 3D performance than the X.org drivers. It is not enabled
|
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:
|
by default because it’s not free software. You can enable it as follows:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
hardware.opengl.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
</programlisting>
|
</programlisting>
|
||||||
You may need to reboot after enabling this driver to prevent a clash
|
You may need to reboot after enabling this driver to prevent a clash
|
||||||
with other kernel modules.</para>
|
with other kernel modules.</para>
|
||||||
|
|
|
@ -1,14 +1,21 @@
|
||||||
{ config, pkgs, pkgs_i686, ... }:
|
{ config, lib, pkgs, pkgs_i686, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (pkgs.lib) mkOption types mkIf optional optionals elem optionalString optionalAttrs;
|
|
||||||
|
|
||||||
cfg = config.hardware.opengl;
|
cfg = config.hardware.opengl;
|
||||||
|
|
||||||
kernelPackages = config.boot.kernelPackages;
|
kernelPackages = config.boot.kernelPackages;
|
||||||
in {
|
|
||||||
|
videoDrivers = config.services.xserver.videoDrivers;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
options = {
|
options = {
|
||||||
hardware.opengl.enable = mkOption {
|
hardware.opengl.enable = mkOption {
|
||||||
description = "Whether this configuration requires opengl.";
|
description = "Whether this configuration requires OpenGL.";
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
internal = true;
|
internal = true;
|
||||||
|
@ -45,18 +52,6 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
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 {
|
config = mkIf cfg.enable {
|
||||||
|
@ -71,21 +66,21 @@ in {
|
||||||
${optionalString (pkgs.stdenv.isi686) "ln -sf opengl-driver /run/opengl-driver-32"}
|
${optionalString (pkgs.stdenv.isi686) "ln -sf opengl-driver /run/opengl-driver-32"}
|
||||||
''
|
''
|
||||||
#TODO: The OpenGL driver should depend on what's detected at runtime.
|
#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
|
ln -sf ${kernelPackages.nvidia_x11} /run/opengl-driver
|
||||||
${optionalString cfg.driSupport32Bit
|
${optionalString cfg.driSupport32Bit
|
||||||
"ln -sf ${pkgs_i686.linuxPackages.nvidia_x11.override { libsOnly = true; kernel = null; } } /run/opengl-driver-32"}
|
"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"
|
"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
|
ln -sf ${kernelPackages.nvidia_x11_legacy304} /run/opengl-driver
|
||||||
${optionalString cfg.driSupport32Bit
|
${optionalString cfg.driSupport32Bit
|
||||||
"ln -sf ${pkgs_i686.linuxPackages.nvidia_x11_legacy304.override { libsOnly = true; kernel = null; } } /run/opengl-driver-32"}
|
"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"
|
"ln -sf ${kernelPackages.ati_drivers_x11} /run/opengl-driver"
|
||||||
else
|
else
|
||||||
let
|
let
|
||||||
|
@ -109,19 +104,20 @@ in {
|
||||||
[ "/run/opengl-driver/lib" "/run/opengl-driver-32/lib" ];
|
[ "/run/opengl-driver/lib" "/run/opengl-driver-32/lib" ];
|
||||||
|
|
||||||
boot.extraModulePackages =
|
boot.extraModulePackages =
|
||||||
optional (elem "nvidia" cfg.videoDrivers) kernelPackages.nvidia_x11 ++
|
optional (elem "nvidia" videoDrivers) kernelPackages.nvidia_x11 ++
|
||||||
optional (elem "nvidiaLegacy173" cfg.videoDrivers) kernelPackages.nvidia_x11_legacy173 ++
|
optional (elem "nvidiaLegacy173" videoDrivers) kernelPackages.nvidia_x11_legacy173 ++
|
||||||
optional (elem "nvidiaLegacy304" cfg.videoDrivers) kernelPackages.nvidia_x11_legacy304 ++
|
optional (elem "nvidiaLegacy304" videoDrivers) kernelPackages.nvidia_x11_legacy304 ++
|
||||||
optional (elem "virtualbox" cfg.videoDrivers) kernelPackages.virtualboxGuestAdditions ++
|
optional (elem "virtualbox" videoDrivers) kernelPackages.virtualboxGuestAdditions ++
|
||||||
optional (elem "ati_unfree" cfg.videoDrivers) kernelPackages.ati_drivers_x11;
|
optional (elem "ati_unfree" videoDrivers) kernelPackages.ati_drivers_x11;
|
||||||
|
|
||||||
boot.blacklistedKernelModules =
|
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";
|
"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";
|
"OpenCL/vendors/nvidia.icd".source = "${kernelPackages.nvidia_x11}/lib/vendors/nvidia.icd";
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -138,7 +138,8 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
# Setting vesa, we don't get the nvidia driver, which can't work in arm.
|
# 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;
|
services.nixosManual.enable = false;
|
||||||
|
|
||||||
# Include the firmware for various wireless cards.
|
# Include the firmware for various wireless cards.
|
||||||
|
|
|
@ -165,7 +165,7 @@ foreach my $path (glob "/sys/bus/pci/devices/*") {
|
||||||
pciCheck $path;
|
pciCheck $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
push @attrs, "hardware.opengl.videoDrivers = [ \"$videoDriver\" ];" if $videoDriver;
|
push @attrs, "services.xserver.videoDrivers = [ \"$videoDriver\" ];" if $videoDriver;
|
||||||
|
|
||||||
|
|
||||||
# Idem for USB devices.
|
# Idem for USB devices.
|
||||||
|
|
|
@ -15,5 +15,5 @@ with lib;
|
||||||
|
|
||||||
# Add some more video drivers to give X11 a shot at working in
|
# Add some more video drivers to give X11 a shot at working in
|
||||||
# VMware and QEMU.
|
# VMware and QEMU.
|
||||||
hardware.opengl.videoDrivers = mkOverride 40 [ "virtualbox" "vmware" "cirrus" "vesa" ];
|
services.xserver.videoDrivers = mkOverride 40 [ "virtualbox" "vmware" "cirrus" "vesa" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ in zipModules ([]
|
||||||
++ obsolete [ "services" "xserver" "driSupport" ] [ "hardware" "opengl" "driSupport" ]
|
++ obsolete [ "services" "xserver" "driSupport" ] [ "hardware" "opengl" "driSupport" ]
|
||||||
++ obsolete [ "services" "xserver" "driSupport32Bit" ] [ "hardware" "opengl" "driSupport32Bit" ]
|
++ obsolete [ "services" "xserver" "driSupport32Bit" ] [ "hardware" "opengl" "driSupport32Bit" ]
|
||||||
++ obsolete [ "services" "xserver" "s3tcSupport" ] [ "hardware" "opengl" "s3tcSupport" ]
|
++ 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" ]
|
++ obsolete [ "services" "mysql55" ] [ "services" "mysql" ]
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ in
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
hardware.opengl.videoDrivers = [];
|
services.xserver.videoDrivers = [];
|
||||||
|
|
||||||
# Enable KDM. Any display manager will do as long as it supports XDMCP.
|
# Enable KDM. Any display manager will do as long as it supports XDMCP.
|
||||||
services.xserver.displayManager.kdm.enable = true;
|
services.xserver.displayManager.kdm.enable = true;
|
||||||
|
|
|
@ -24,7 +24,7 @@ let
|
||||||
intel-testing = { modules = with pkgs.xorg; [ xf86videointel-testing glamoregl ]; driverName = "intel"; };
|
intel-testing = { modules = with pkgs.xorg; [ xf86videointel-testing glamoregl ]; driverName = "intel"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
driverNames = config.hardware.opengl.videoDrivers;
|
driverNames = cfg.videoDrivers;
|
||||||
|
|
||||||
needsAcpid =
|
needsAcpid =
|
||||||
(elem "nvidia" driverNames) ||
|
(elem "nvidia" driverNames) ||
|
||||||
|
@ -181,6 +181,18 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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 {
|
videoDriver = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -188,7 +200,7 @@ in
|
||||||
description = ''
|
description = ''
|
||||||
The name of the video driver for your graphics card. This
|
The name of the video driver for your graphics card. This
|
||||||
option is obsolete; please set the
|
option is obsolete; please set the
|
||||||
<option>hardware.opengl.videoDrivers</option> instead.
|
<option>services.xserver.videoDrivers</option> instead.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -386,7 +398,7 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
hardware.opengl.enable = true;
|
hardware.opengl.enable = true;
|
||||||
hardware.opengl.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
|
services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
|
||||||
|
|
||||||
assertions =
|
assertions =
|
||||||
[ { assertion = !(config.programs.ssh.startAgent && cfg.startGnuPGAgent);
|
[ { assertion = !(config.programs.ssh.startAgent && cfg.startGnuPGAgent);
|
||||||
|
|
|
@ -386,7 +386,7 @@ in
|
||||||
|
|
||||||
# When building a regular system configuration, override whatever
|
# When building a regular system configuration, override whatever
|
||||||
# video driver the host uses.
|
# video driver the host uses.
|
||||||
hardware.opengl.videoDrivers = mkVMOverride [ "vesa" ];
|
services.xserver.videoDrivers = mkVMOverride [ "vesa" ];
|
||||||
services.xserver.defaultDepth = mkVMOverride 0;
|
services.xserver.defaultDepth = mkVMOverride 0;
|
||||||
services.xserver.resolutions = mkVMOverride [ { x = 1024; y = 768; } ];
|
services.xserver.resolutions = mkVMOverride [ { x = 1024; y = 768; } ];
|
||||||
services.xserver.monitorSection =
|
services.xserver.monitorSection =
|
||||||
|
|
|
@ -54,7 +54,7 @@ optionalAttrs (pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) # ugly...
|
||||||
serviceConfig.ExecStart = "@${kernel.virtualboxGuestAdditions}/sbin/VBoxService VBoxService --foreground";
|
serviceConfig.ExecStart = "@${kernel.virtualboxGuestAdditions}/sbin/VBoxService VBoxService --foreground";
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.opengl.videoDrivers = mkOverride 50 [ "virtualbox" ];
|
services.xserver.videoDrivers = mkOverride 50 [ "virtualbox" ];
|
||||||
|
|
||||||
services.xserver.config =
|
services.xserver.config =
|
||||||
''
|
''
|
||||||
|
|
Loading…
Reference in a new issue