mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
services.mesa -> hardware.opengl
Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
parent
4a1e74673a
commit
dea562b6b9
@ -2,19 +2,19 @@
|
||||
let
|
||||
inherit (pkgs.lib) mkOption types mkIf optional optionals elem optionalString optionalAttrs;
|
||||
|
||||
cfg = config.services.mesa;
|
||||
cfg = config.hardware.opengl;
|
||||
|
||||
kernelPackages = config.boot.kernelPackages;
|
||||
in {
|
||||
options = {
|
||||
services.mesa.enable = mkOption {
|
||||
description = "Whether this configuration requires mesa.";
|
||||
hardware.opengl.enable = mkOption {
|
||||
description = "Whether this configuration requires opengl.";
|
||||
type = types.bool;
|
||||
default = false;
|
||||
internal = true;
|
||||
};
|
||||
|
||||
services.mesa.driSupport = mkOption {
|
||||
hardware.opengl.driSupport = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
@ -23,18 +23,18 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
services.mesa.driSupport32Bit = mkOption {
|
||||
hardware.opengl.driSupport32Bit = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
On 64-bit systems, whether to support Direct Rendering for
|
||||
32-bit applications (such as Wine). This is currently only
|
||||
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;
|
||||
default = false;
|
||||
description = ''
|
||||
@ -47,15 +47,15 @@ in {
|
||||
};
|
||||
|
||||
|
||||
services.mesa.videoDrivers = mkOption {
|
||||
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 video drivers that the mesa should
|
||||
support. Mesa will try all of the drivers listed
|
||||
here until it finds one that supports your video card.
|
||||
The names of the opengl video drivers the configuration
|
||||
supports. They will be tried in order until one that
|
||||
supports your card is found.
|
||||
'';
|
||||
};
|
||||
};
|
@ -29,6 +29,7 @@
|
||||
./hardware/network/intel-3945abg.nix
|
||||
./hardware/network/ralink.nix
|
||||
./hardware/network/rtl8192c.nix
|
||||
./hardware/opengl.nix
|
||||
./hardware/pcmcia.nix
|
||||
./installer/tools/nixos-checkout.nix
|
||||
./installer/tools/tools.nix
|
||||
@ -235,7 +236,6 @@
|
||||
./services/x11/hardware/multitouch.nix
|
||||
./services/x11/hardware/synaptics.nix
|
||||
./services/x11/hardware/wacom.nix
|
||||
./services/x11/mesa.nix
|
||||
./services/x11/window-managers/awesome.nix
|
||||
#./services/x11/window-managers/compiz.nix
|
||||
./services/x11/window-managers/default.nix
|
||||
|
@ -119,6 +119,10 @@ in zipModules ([]
|
||||
++ obsolete [ "services" "xserver" "driSupport32Bit" ] [ "services" "mesa" "driSupport32Bit" ]
|
||||
++ obsolete [ "services" "xserver" "s3tcSupport" ] [ "services" "mesa" "s3tcSupport" ]
|
||||
++ 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.
|
||||
++ obsolete' [ "boot" "loader" "grub" "bootDevice" ]
|
||||
|
@ -73,6 +73,6 @@ in {
|
||||
hwaccel
|
||||
'';
|
||||
|
||||
services.mesa.enable = mkIf cfg.hwRender true;
|
||||
hardware.opengl.enable = mkIf cfg.hwRender true;
|
||||
};
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ let
|
||||
virtualbox = { modules = [ kernelPackages.virtualboxGuestAdditions ]; driverName = "vboxvideo"; };
|
||||
};
|
||||
|
||||
driverNames = config.services.mesa.videoDrivers;
|
||||
driverNames = config.hardware.opengl.videoDrivers;
|
||||
|
||||
drivers = flip map driverNames
|
||||
(name: { inherit name; driverName = name; } //
|
||||
@ -181,7 +181,7 @@ in
|
||||
description = ''
|
||||
The name of the video driver for your graphics card. This
|
||||
option is obsolete; please set the
|
||||
<option>services.mesa.videoDrivers</option> instead.
|
||||
<option>hardware.opengl.videoDrivers</option> instead.
|
||||
'';
|
||||
};
|
||||
|
||||
@ -381,8 +381,8 @@ in
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.mesa.enable = true;
|
||||
services.mesa.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
|
||||
hardware.opengl.enable = true;
|
||||
hardware.opengl.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
|
||||
|
||||
assertions =
|
||||
[ { assertion = !(cfg.startOpenSSHAgent && cfg.startGnuPGAgent);
|
||||
|
@ -387,7 +387,7 @@ in
|
||||
# When building a regular system configuration, override whatever
|
||||
# video driver the host uses.
|
||||
services.xserver.videoDriver = mkVMOverride null;
|
||||
services.mesa.videoDrivers = mkVMOverride [ "vesa" ];
|
||||
hardware.opengl.videoDrivers = mkVMOverride [ "vesa" ];
|
||||
services.xserver.defaultDepth = mkVMOverride 0;
|
||||
services.xserver.resolutions = mkVMOverride [ { x = 1024; y = 768; } ];
|
||||
services.xserver.monitorSection =
|
||||
|
@ -52,7 +52,7 @@ optionalAttrs (pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) # ugly...
|
||||
serviceConfig.ExecStart = "@${kernel.virtualboxGuestAdditions}/sbin/VBoxService VBoxService --foreground";
|
||||
};
|
||||
|
||||
services.mesa.videoDrivers = mkOverride 50 [ "virtualbox" ];
|
||||
hardware.opengl.videoDrivers = mkOverride 50 [ "virtualbox" ];
|
||||
|
||||
services.xserver.config =
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user