remove driSupport, opengl → graphics

This commit is contained in:
toastal 2024-06-21 20:44:42 +07:00 committed by mergify[bot]
parent 083823b790
commit cc634b69c8
20 changed files with 77 additions and 80 deletions

View file

@ -19,9 +19,6 @@
]; ];
}; };
# TODO: reverse compat
hardware.opengl.driSupport = false;
# TODO: reverse compat # TODO: reverse compat
services.xserver = { services.xserver = {
defaultDepth = lib.mkDefault 24; defaultDepth = lib.mkDefault 24;

View file

@ -1,3 +1,5 @@
{ lib, ... }:
{ {
imports = [ imports = [
../. ../.
@ -5,7 +7,7 @@
]; ];
# TODO: reverse compat # TODO: reverse compat
hardware.opengl.driSupport32Bit = true; hardware.graphics.enable32Bit = lib.mkDefault true;
services.xserver = { services.xserver = {
# TODO: we should not enable unfree drivers # TODO: we should not enable unfree drivers

View file

@ -12,17 +12,18 @@ in
services.xserver.videoDrivers = mkDefault [ "nvidiaLegacy340" ]; services.xserver.videoDrivers = mkDefault [ "nvidiaLegacy340" ];
hardware.opengl = { hardware = {
enable = mkDefault true; graphics = {
driSupport = mkDefault true; enable = mkDefault true;
driSupport32Bit = mkDefault true; enable32Bit = mkDefault true;
}; };
hardware.nvidia = { nvidia = {
modesetting.enable = mkDefault true; modesetting.enable = mkDefault true;
powerManagement.enable = mkDefault false; powerManagement.enable = mkDefault false;
powerManagement.finegrained = mkDefault false; powerManagement.finegrained = mkDefault false;
open = mkDefault false; open = mkDefault false;
nvidiaSettings = mkDefault true; nvidiaSettings = mkDefault true;
};
}; };
} }

View file

@ -26,7 +26,7 @@ in {
hardware = { hardware = {
amdgpu.loadInInitrd = true; amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [ graphics.extraPackages = with pkgs; [
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
]; ];

View file

@ -26,7 +26,7 @@ in {
hardware = { hardware = {
## Enable the Nvidia card, as well as Prime and Offload: ## Enable the Nvidia card, as well as Prime and Offload:
amdgpu.loadInInitrd = true; amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [ graphics.extraPackages = with pkgs; [
# Also in nvidia/default.nix # Also in nvidia/default.nix
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl

View file

@ -11,9 +11,9 @@
{ {
services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ]; services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ];
hardware.opengl = { hardware.graphics = {
driSupport = lib.mkDefault true; enable = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true; enable32Bit = lib.mkDefault true;
}; };
} }
(lib.mkIf config.hardware.amdgpu.loadInInitrd { (lib.mkIf config.hardware.amdgpu.loadInInitrd {

View file

@ -26,10 +26,10 @@
boot.initrd.kernelModules = [ config.hardware.intelgpu.driver ]; boot.initrd.kernelModules = [ config.hardware.intelgpu.driver ];
environment.variables = { 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 if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
vaapiIntel vaapiIntel
@ -40,7 +40,7 @@
intel-media-driver 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 if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
vaapiIntel vaapiIntel

View file

@ -2,7 +2,7 @@
{ {
services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ];
hardware.opengl.extraPackages = with pkgs; [ hardware.graphics.extraPackages = with pkgs; [
vaapiVdpau vaapiVdpau
]; ];
} }

View file

@ -21,25 +21,26 @@
}; };
boot.kernelParams = ["i915.modeset=1"]; boot.kernelParams = ["i915.modeset=1"];
hardware.nvidia = { hardware = {
package = config.boot.kernelPackages.nvidiaPackages.legacy_390; graphics = {
nvidiaSettings = lib.mkDefault true; enable = lib.mkDefault true;
modesetting.enable = lib.mkDefault true; enable32Bit = lib.mkDefault true;
open = lib.mkDefault false; };
prime = { nvidia = {
intelBusId = "PCI:0:2:0"; package = config.boot.kernelPackages.nvidiaPackages.legacy_390;
nvidiaBusId = "PCI:1:0:0"; 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 # Override the intel gpu driver setting imported above
environment.variables = { 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; services.thermald.enable = lib.mkDefault true;

View file

@ -5,6 +5,11 @@
services.switcherooControl.enable = lib.mkDefault true; services.switcherooControl.enable = lib.mkDefault true;
hardware = { hardware = {
graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ];
};
nvidia = { nvidia = {
prime = { prime = {
# Bus ID of the Intel GPU. # Bus ID of the Intel GPU.
@ -20,10 +25,5 @@
finegrained = lib.mkDefault true; finegrained = lib.mkDefault true;
}; };
}; };
opengl = {
enable = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true;
extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ];
};
}; };
} }

View file

@ -18,10 +18,9 @@
boot.blacklistedKernelModules = [ "i2c_nvidia_gpu" ]; boot.blacklistedKernelModules = [ "i2c_nvidia_gpu" ];
hardware.nvidia.modesetting.enable = lib.mkDefault true; hardware.nvidia.modesetting.enable = lib.mkDefault true;
hardware.opengl = { hardware.graphics = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
driSupport = lib.mkDefault true; enable32Bit = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true;
}; };
hardware.nvidia.prime = { hardware.nvidia.prime = {

View file

@ -14,7 +14,7 @@ in
# GPU is an Intel Iris Xe, on a “TigerLake” mobile CPU # 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 boot.initrd.kernelModules = [ "i915" ]; # Early loading so the passphrase prompt appears on external displays
services.xserver.videoDrivers = [ "intel" ]; services.xserver.videoDrivers = [ "intel" ];
hardware.opengl.extraPackages = with pkgs; [ hardware.graphics.extraPackages = with pkgs; [
intel-media-driver intel-media-driver
(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver) (if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver)
]; ];

View file

@ -1,13 +1,18 @@
{ lib, ... }: { lib, ... }:
{ {
hardware.nvidia.modesetting.enable = true; hardware = {
hardware.opengl.driSupport32Bit = true; graphics = {
hardware.opengl.enable = true; enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
hardware.nvidia.prime = { };
# Bus ID of the Intel GPU. nvidia = {
intelBusId = lib.mkDefault "PCI:0:2:0"; modesetting.enable = lib.mkDefault true;
# Bus ID of the NVIDIA GPU. prime = {
nvidiaBusId = lib.mkDefault "PCI:1:0:0"; # 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";
};
};
}; };
} }

View file

@ -13,12 +13,6 @@
nvidiaBusId = lib.mkDefault "PCI:1:0: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 # required to make wireless work

View file

@ -8,18 +8,17 @@
]; ];
hardware = { hardware = {
graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
};
nvidia = { nvidia = {
prime = { prime = {
intelBusId = lib.mkDefault "PCI:0:2:0"; intelBusId = lib.mkDefault "PCI:0:2:0";
nvidiaBusId = lib.mkDefault "PCI:1:0: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 # required to make wireless work

View file

@ -7,18 +7,18 @@
]; ];
hardware = { hardware = {
# is this too much? It's convenient for Steam.
graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
};
nvidia = { nvidia = {
prime = { prime = {
intelBusId = lib.mkDefault "PCI:0:2:0"; intelBusId = lib.mkDefault "PCI:0:2:0";
nvidiaBusId = lib.mkDefault "PCI:1:0: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 # required to make wireless work

View file

@ -7,7 +7,7 @@
]; ];
boot.initrd.kernelModules = [ "ideapad_laptop" ]; boot.initrd.kernelModules = [ "ideapad_laptop" ];
hardware.opengl.extraPackages = with pkgs; [ hardware.graphics.extraPackages = with pkgs; [
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
]; ];

View file

@ -15,7 +15,7 @@ in {
hardware = { hardware = {
amdgpu.loadInInitrd = true; amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [ graphics.extraPackages = with pkgs; [
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
]; ];

View file

@ -19,7 +19,7 @@ in {
hardware = { hardware = {
## Enable the Nvidia card, as well as Prime and Offload: ## Enable the Nvidia card, as well as Prime and Offload:
amdgpu.loadInInitrd = true; amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [ graphics.extraPackages = with pkgs; [
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
]; ];

View file

@ -7,10 +7,9 @@
boot.initrd.kernelModules = [ "nvidia" ]; boot.initrd.kernelModules = [ "nvidia" ];
hardware.opengl = { hardware.graphics = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
# adds ~100MB of 32-bit mesa drivers. enable32Bit = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true;
}; };
hardware.nvidia = { hardware.nvidia = {