diff --git a/nixos/modules/services/x11/mesa.nix b/nixos/modules/hardware/opengl.nix similarity index 89% rename from nixos/modules/services/x11/mesa.nix rename to nixos/modules/hardware/opengl.nix index 12fc7ae1178..603012cb109 100644 --- a/nixos/modules/services/x11/mesa.nix +++ b/nixos/modules/hardware/opengl.nix @@ -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 nvidia driver and for - mesa. + Mesa. ''; }; - 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. ''; }; }; diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index aa4bada8b28..5d52f71c9ff 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -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 diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 15e05a3d675..8393b5758f3 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.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" ] diff --git a/nixos/modules/services/ttys/kmscon.nix b/nixos/modules/services/ttys/kmscon.nix index 302e660a7bf..eb68a3d95d8 100644 --- a/nixos/modules/services/ttys/kmscon.nix +++ b/nixos/modules/services/ttys/kmscon.nix @@ -73,6 +73,6 @@ in { hwaccel ''; - services.mesa.enable = mkIf cfg.hwRender true; + hardware.opengl.enable = mkIf cfg.hwRender true; }; } diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 5600ce7fac1..2677f758456 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -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 - instead. + 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); diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 2483ee63d57..4f7f6ae8f2b 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -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 = diff --git a/nixos/modules/virtualisation/virtualbox-guest.nix b/nixos/modules/virtualisation/virtualbox-guest.nix index 9dda455e5d3..e4c00fe4a41 100644 --- a/nixos/modules/virtualisation/virtualbox-guest.nix +++ b/nixos/modules/virtualisation/virtualbox-guest.nix @@ -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 = ''