From cc634b69c8312c4e88469d3c7e8fb5ecc72e7dc6 Mon Sep 17 00:00:00 2001 From: toastal Date: Fri, 21 Jun 2024 20:44:42 +0700 Subject: [PATCH] =?UTF-8?q?remove=20driSupport,=20opengl=20=E2=86=92=20gra?= =?UTF-8?q?phics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acer/aspire/4810t/default.nix | 3 --- apple/macbook-pro/10-1/default.nix | 4 +++- apple/macmini/4/default.nix | 23 ++++++++++---------- asus/zephyrus/ga402x/amdgpu/default.nix | 2 +- asus/zephyrus/ga402x/nvidia/default.nix | 2 +- common/gpu/amd/default.nix | 6 ++--- common/gpu/intel/default.nix | 6 ++--- common/gpu/nvidia/default.nix | 2 +- dell/precision/7520/default.nix | 29 +++++++++++++------------ dell/xps/15-9510/nvidia/default.nix | 10 ++++----- focus/m2/gen1/default.nix | 5 ++--- gpd/pocket-3/default.nix | 2 +- lenovo/thinkpad/p1/3th-gen/nvidia.nix | 23 ++++++++++++-------- lenovo/thinkpad/p50/default.nix | 6 ----- lenovo/thinkpad/p51/default.nix | 11 +++++----- lenovo/thinkpad/p52/default.nix | 12 +++++----- lenovo/yoga/6/13ALC6/default.nix | 2 +- lenovo/yoga/7/14ARH7/amdgpu/default.nix | 2 +- lenovo/yoga/7/14ARH7/nvidia/default.nix | 2 +- system76/gaze18/default.nix | 5 ++--- 20 files changed, 77 insertions(+), 80 deletions(-) diff --git a/acer/aspire/4810t/default.nix b/acer/aspire/4810t/default.nix index d40b454..c0f95dc 100644 --- a/acer/aspire/4810t/default.nix +++ b/acer/aspire/4810t/default.nix @@ -19,9 +19,6 @@ ]; }; - # TODO: reverse compat - hardware.opengl.driSupport = false; - # TODO: reverse compat services.xserver = { defaultDepth = lib.mkDefault 24; diff --git a/apple/macbook-pro/10-1/default.nix b/apple/macbook-pro/10-1/default.nix index 3703096..f3f58c2 100644 --- a/apple/macbook-pro/10-1/default.nix +++ b/apple/macbook-pro/10-1/default.nix @@ -1,3 +1,5 @@ +{ lib, ... }: + { imports = [ ../. @@ -5,7 +7,7 @@ ]; # TODO: reverse compat - hardware.opengl.driSupport32Bit = true; + hardware.graphics.enable32Bit = lib.mkDefault true; services.xserver = { # TODO: we should not enable unfree drivers diff --git a/apple/macmini/4/default.nix b/apple/macmini/4/default.nix index fd3062d..86210c4 100644 --- a/apple/macmini/4/default.nix +++ b/apple/macmini/4/default.nix @@ -12,17 +12,18 @@ in services.xserver.videoDrivers = mkDefault [ "nvidiaLegacy340" ]; - hardware.opengl = { - enable = mkDefault true; - driSupport = mkDefault true; - driSupport32Bit = mkDefault true; - }; + hardware = { + graphics = { + enable = mkDefault true; + enable32Bit = mkDefault true; + }; - hardware.nvidia = { - modesetting.enable = mkDefault true; - powerManagement.enable = mkDefault false; - powerManagement.finegrained = mkDefault false; - open = mkDefault false; - nvidiaSettings = mkDefault true; + nvidia = { + modesetting.enable = mkDefault true; + powerManagement.enable = mkDefault false; + powerManagement.finegrained = mkDefault false; + open = mkDefault false; + nvidiaSettings = mkDefault true; + }; }; } diff --git a/asus/zephyrus/ga402x/amdgpu/default.nix b/asus/zephyrus/ga402x/amdgpu/default.nix index 17103c5..80a508f 100644 --- a/asus/zephyrus/ga402x/amdgpu/default.nix +++ b/asus/zephyrus/ga402x/amdgpu/default.nix @@ -26,7 +26,7 @@ in { hardware = { amdgpu.loadInInitrd = true; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/asus/zephyrus/ga402x/nvidia/default.nix b/asus/zephyrus/ga402x/nvidia/default.nix index 7a1a8c3..73a2b9d 100644 --- a/asus/zephyrus/ga402x/nvidia/default.nix +++ b/asus/zephyrus/ga402x/nvidia/default.nix @@ -26,7 +26,7 @@ in { hardware = { ## Enable the Nvidia card, as well as Prime and Offload: amdgpu.loadInInitrd = true; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ # Also in nvidia/default.nix vaapiVdpau libvdpau-va-gl diff --git a/common/gpu/amd/default.nix b/common/gpu/amd/default.nix index 6987d6e..9228bc3 100644 --- a/common/gpu/amd/default.nix +++ b/common/gpu/amd/default.nix @@ -11,9 +11,9 @@ { services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ]; - hardware.opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; + hardware.graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; }; } (lib.mkIf config.hardware.amdgpu.loadInInitrd { diff --git a/common/gpu/intel/default.nix b/common/gpu/intel/default.nix index 91c8765..90afad1 100644 --- a/common/gpu/intel/default.nix +++ b/common/gpu/intel/default.nix @@ -26,10 +26,10 @@ boot.initrd.kernelModules = [ config.hardware.intelgpu.driver ]; environment.variables = { - VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl"); + VDPAU_DRIVER = lib.mkIf config.hardware.graphics.enable (lib.mkDefault "va_gl"); }; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ ( if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel @@ -40,7 +40,7 @@ intel-media-driver ]; - hardware.opengl.extraPackages32 = with pkgs.driversi686Linux; [ + hardware.graphics.extraPackages32 = with pkgs.driversi686Linux; [ ( if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel diff --git a/common/gpu/nvidia/default.nix b/common/gpu/nvidia/default.nix index 47f2d34..43b4608 100644 --- a/common/gpu/nvidia/default.nix +++ b/common/gpu/nvidia/default.nix @@ -2,7 +2,7 @@ { services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ vaapiVdpau ]; } diff --git a/dell/precision/7520/default.nix b/dell/precision/7520/default.nix index c20ea89..db5626f 100644 --- a/dell/precision/7520/default.nix +++ b/dell/precision/7520/default.nix @@ -21,25 +21,26 @@ }; boot.kernelParams = ["i915.modeset=1"]; - hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.legacy_390; - nvidiaSettings = lib.mkDefault true; - modesetting.enable = lib.mkDefault true; - open = lib.mkDefault false; - prime = { - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; + hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.legacy_390; + nvidiaSettings = lib.mkDefault true; + modesetting.enable = lib.mkDefault true; + open = lib.mkDefault false; + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; }; - }; - hardware.opengl = { - enable = lib.mkDefault true; - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; }; # Override the intel gpu driver setting imported above environment.variables = { - VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkOverride 990 "nvidia"); + VDPAU_DRIVER = lib.mkIf config.hardware.graphics.enable (lib.mkOverride 990 "nvidia"); }; services.thermald.enable = lib.mkDefault true; diff --git a/dell/xps/15-9510/nvidia/default.nix b/dell/xps/15-9510/nvidia/default.nix index 723c574..990aea7 100644 --- a/dell/xps/15-9510/nvidia/default.nix +++ b/dell/xps/15-9510/nvidia/default.nix @@ -5,6 +5,11 @@ services.switcherooControl.enable = lib.mkDefault true; hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ]; + }; nvidia = { prime = { # Bus ID of the Intel GPU. @@ -20,10 +25,5 @@ finegrained = lib.mkDefault true; }; }; - opengl = { - enable = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ]; - }; }; } diff --git a/focus/m2/gen1/default.nix b/focus/m2/gen1/default.nix index 74e4df3..27ee1f3 100644 --- a/focus/m2/gen1/default.nix +++ b/focus/m2/gen1/default.nix @@ -18,10 +18,9 @@ boot.blacklistedKernelModules = [ "i2c_nvidia_gpu" ]; hardware.nvidia.modesetting.enable = lib.mkDefault true; - hardware.opengl = { + hardware.graphics = { enable = lib.mkDefault true; - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; + enable32Bit = lib.mkDefault true; }; hardware.nvidia.prime = { diff --git a/gpd/pocket-3/default.nix b/gpd/pocket-3/default.nix index 52d0913..73d2bed 100644 --- a/gpd/pocket-3/default.nix +++ b/gpd/pocket-3/default.nix @@ -14,7 +14,7 @@ in # GPU is an Intel Iris Xe, on a “TigerLake” mobile CPU boot.initrd.kernelModules = [ "i915" ]; # Early loading so the passphrase prompt appears on external displays services.xserver.videoDrivers = [ "intel" ]; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ intel-media-driver (if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver) ]; diff --git a/lenovo/thinkpad/p1/3th-gen/nvidia.nix b/lenovo/thinkpad/p1/3th-gen/nvidia.nix index 0808107..6f939e9 100644 --- a/lenovo/thinkpad/p1/3th-gen/nvidia.nix +++ b/lenovo/thinkpad/p1/3th-gen/nvidia.nix @@ -1,13 +1,18 @@ { lib, ... }: { - hardware.nvidia.modesetting.enable = true; - hardware.opengl.driSupport32Bit = true; - hardware.opengl.enable = true; - - hardware.nvidia.prime = { - # Bus ID of the Intel GPU. - intelBusId = lib.mkDefault "PCI:0:2:0"; - # Bus ID of the NVIDIA GPU. - nvidiaBusId = lib.mkDefault "PCI:1:0:0"; + hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { + modesetting.enable = lib.mkDefault true; + prime = { + # Bus ID of the Intel GPU. + intelBusId = lib.mkDefault "PCI:0:2:0"; + # Bus ID of the NVIDIA GPU. + nvidiaBusId = lib.mkDefault "PCI:1:0:0"; + }; + }; }; } diff --git a/lenovo/thinkpad/p50/default.nix b/lenovo/thinkpad/p50/default.nix index 3e77eb5..ef2cbd5 100644 --- a/lenovo/thinkpad/p50/default.nix +++ b/lenovo/thinkpad/p50/default.nix @@ -13,12 +13,6 @@ nvidiaBusId = lib.mkDefault "PCI:1:0:0"; }; }; - - # is this too much? It's convenient for Steam. - opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - }; }; # required to make wireless work diff --git a/lenovo/thinkpad/p51/default.nix b/lenovo/thinkpad/p51/default.nix index 4c9be3c..ca86455 100644 --- a/lenovo/thinkpad/p51/default.nix +++ b/lenovo/thinkpad/p51/default.nix @@ -8,18 +8,17 @@ ]; hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { prime = { intelBusId = lib.mkDefault "PCI:0:2:0"; nvidiaBusId = lib.mkDefault "PCI:1:0:0"; }; }; - - # is this too much? It's convenient for Steam. - opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - }; }; # required to make wireless work diff --git a/lenovo/thinkpad/p52/default.nix b/lenovo/thinkpad/p52/default.nix index 31c9294..e768923 100644 --- a/lenovo/thinkpad/p52/default.nix +++ b/lenovo/thinkpad/p52/default.nix @@ -7,18 +7,18 @@ ]; hardware = { + # is this too much? It's convenient for Steam. + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { prime = { intelBusId = lib.mkDefault "PCI:0:2:0"; nvidiaBusId = lib.mkDefault "PCI:1:0:0"; }; }; - - # is this too much? It's convenient for Steam. - opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - }; }; # required to make wireless work diff --git a/lenovo/yoga/6/13ALC6/default.nix b/lenovo/yoga/6/13ALC6/default.nix index bd2e80c..1177bc7 100644 --- a/lenovo/yoga/6/13ALC6/default.nix +++ b/lenovo/yoga/6/13ALC6/default.nix @@ -7,7 +7,7 @@ ]; boot.initrd.kernelModules = [ "ideapad_laptop" ]; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/lenovo/yoga/7/14ARH7/amdgpu/default.nix b/lenovo/yoga/7/14ARH7/amdgpu/default.nix index 4d16de0..6630911 100644 --- a/lenovo/yoga/7/14ARH7/amdgpu/default.nix +++ b/lenovo/yoga/7/14ARH7/amdgpu/default.nix @@ -15,7 +15,7 @@ in { hardware = { amdgpu.loadInInitrd = true; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/lenovo/yoga/7/14ARH7/nvidia/default.nix b/lenovo/yoga/7/14ARH7/nvidia/default.nix index fb4553e..6c97a07 100644 --- a/lenovo/yoga/7/14ARH7/nvidia/default.nix +++ b/lenovo/yoga/7/14ARH7/nvidia/default.nix @@ -19,7 +19,7 @@ in { hardware = { ## Enable the Nvidia card, as well as Prime and Offload: amdgpu.loadInInitrd = true; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/system76/gaze18/default.nix b/system76/gaze18/default.nix index 7b87f1a..0485e16 100644 --- a/system76/gaze18/default.nix +++ b/system76/gaze18/default.nix @@ -7,10 +7,9 @@ boot.initrd.kernelModules = [ "nvidia" ]; - hardware.opengl = { + hardware.graphics = { enable = lib.mkDefault true; - # adds ~100MB of 32-bit mesa drivers. - driSupport32Bit = lib.mkDefault true; + enable32Bit = lib.mkDefault true; }; hardware.nvidia = {