services.mesa -> hardware.opengl

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2014-02-08 14:45:28 -05:00
parent 4a1e74673a
commit dea562b6b9
7 changed files with 23 additions and 19 deletions

View file

@ -2,19 +2,19 @@
let let
inherit (pkgs.lib) mkOption types mkIf optional optionals elem optionalString optionalAttrs; inherit (pkgs.lib) mkOption types mkIf optional optionals elem optionalString optionalAttrs;
cfg = config.services.mesa; cfg = config.hardware.opengl;
kernelPackages = config.boot.kernelPackages; kernelPackages = config.boot.kernelPackages;
in { in {
options = { options = {
services.mesa.enable = mkOption { hardware.opengl.enable = mkOption {
description = "Whether this configuration requires mesa."; description = "Whether this configuration requires opengl.";
type = types.bool; type = types.bool;
default = false; default = false;
internal = true; internal = true;
}; };
services.mesa.driSupport = mkOption { hardware.opengl.driSupport = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = '' description = ''
@ -23,18 +23,18 @@ in {
''; '';
}; };
services.mesa.driSupport32Bit = mkOption { hardware.opengl.driSupport32Bit = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = '' description = ''
On 64-bit systems, whether to support Direct Rendering for On 64-bit systems, whether to support Direct Rendering for
32-bit applications (such as Wine). This is currently only 32-bit applications (such as Wine). This is currently only
supported for the <literal>nvidia</literal> driver and for supported for the <literal>nvidia</literal> driver and for
<literal>mesa</literal>. <literal>Mesa</literal>.
''; '';
}; };
services.mesa.s3tcSupport = mkOption { hardware.opengl.s3tcSupport = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = '' description = ''
@ -47,15 +47,15 @@ in {
}; };
services.mesa.videoDrivers = mkOption { hardware.opengl.videoDrivers = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
# !!! We'd like "nv" here, but it segfaults the X server. # !!! We'd like "nv" here, but it segfaults the X server.
default = [ "ati" "cirrus" "intel" "vesa" "vmware" ]; default = [ "ati" "cirrus" "intel" "vesa" "vmware" ];
example = [ "vesa" ]; example = [ "vesa" ];
description = '' description = ''
The names of the video drivers that the mesa should The names of the opengl video drivers the configuration
support. Mesa will try all of the drivers listed supports. They will be tried in order until one that
here until it finds one that supports your video card. supports your card is found.
''; '';
}; };
}; };

View file

@ -29,6 +29,7 @@
./hardware/network/intel-3945abg.nix ./hardware/network/intel-3945abg.nix
./hardware/network/ralink.nix ./hardware/network/ralink.nix
./hardware/network/rtl8192c.nix ./hardware/network/rtl8192c.nix
./hardware/opengl.nix
./hardware/pcmcia.nix ./hardware/pcmcia.nix
./installer/tools/nixos-checkout.nix ./installer/tools/nixos-checkout.nix
./installer/tools/tools.nix ./installer/tools/tools.nix
@ -235,7 +236,6 @@
./services/x11/hardware/multitouch.nix ./services/x11/hardware/multitouch.nix
./services/x11/hardware/synaptics.nix ./services/x11/hardware/synaptics.nix
./services/x11/hardware/wacom.nix ./services/x11/hardware/wacom.nix
./services/x11/mesa.nix
./services/x11/window-managers/awesome.nix ./services/x11/window-managers/awesome.nix
#./services/x11/window-managers/compiz.nix #./services/x11/window-managers/compiz.nix
./services/x11/window-managers/default.nix ./services/x11/window-managers/default.nix

View file

@ -119,6 +119,10 @@ in zipModules ([]
++ obsolete [ "services" "xserver" "driSupport32Bit" ] [ "services" "mesa" "driSupport32Bit" ] ++ obsolete [ "services" "xserver" "driSupport32Bit" ] [ "services" "mesa" "driSupport32Bit" ]
++ obsolete [ "services" "xserver" "s3tcSupport" ] [ "services" "mesa" "s3tcSupport" ] ++ obsolete [ "services" "xserver" "s3tcSupport" ] [ "services" "mesa" "s3tcSupport" ]
++ obsolete [ "services" "xserver" "videoDrivers" ] [ "services" "mesa" "videoDrivers" ] ++ obsolete [ "services" "xserver" "videoDrivers" ] [ "services" "mesa" "videoDrivers" ]
++ obsolete [ "services" "mesa" "driSupport" ] [ "hardware" "opengl" "driSupport" ]
++ obsolete [ "services" "mesa" "driSupport32Bit" ] [ "hardware" "opengl" "driSupport32Bit" ]
++ obsolete [ "services" "mesa" "s3tcSupport" ] [ "hardware" "opengl" "s3tcSupport" ]
++ obsolete [ "services" "mesa" "videoDrivers" ] [ "hardware" "opengl" "videoDrivers" ]
# Options that are obsolete and have no replacement. # Options that are obsolete and have no replacement.
++ obsolete' [ "boot" "loader" "grub" "bootDevice" ] ++ obsolete' [ "boot" "loader" "grub" "bootDevice" ]

View file

@ -73,6 +73,6 @@ in {
hwaccel hwaccel
''; '';
services.mesa.enable = mkIf cfg.hwRender true; hardware.opengl.enable = mkIf cfg.hwRender true;
}; };
} }

View file

@ -22,7 +22,7 @@ let
virtualbox = { modules = [ kernelPackages.virtualboxGuestAdditions ]; driverName = "vboxvideo"; }; virtualbox = { modules = [ kernelPackages.virtualboxGuestAdditions ]; driverName = "vboxvideo"; };
}; };
driverNames = config.services.mesa.videoDrivers; driverNames = config.hardware.opengl.videoDrivers;
drivers = flip map driverNames drivers = flip map driverNames
(name: { inherit name; driverName = name; } // (name: { inherit name; driverName = name; } //
@ -181,7 +181,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>services.mesa.videoDrivers</option> instead. <option>hardware.opengl.videoDrivers</option> instead.
''; '';
}; };
@ -381,8 +381,8 @@ in
###### implementation ###### implementation
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.mesa.enable = true; hardware.opengl.enable = true;
services.mesa.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ]; hardware.opengl.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
assertions = assertions =
[ { assertion = !(cfg.startOpenSSHAgent && cfg.startGnuPGAgent); [ { assertion = !(cfg.startOpenSSHAgent && cfg.startGnuPGAgent);

View file

@ -387,7 +387,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.
services.xserver.videoDriver = mkVMOverride null; services.xserver.videoDriver = mkVMOverride null;
services.mesa.videoDrivers = mkVMOverride [ "vesa" ]; hardware.opengl.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 =

View file

@ -52,7 +52,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";
}; };
services.mesa.videoDrivers = mkOverride 50 [ "virtualbox" ]; hardware.opengl.videoDrivers = mkOverride 50 [ "virtualbox" ];
services.xserver.config = services.xserver.config =
'' ''