diff --git a/hosts/orion/modules/graphical.nix b/hosts/orion/modules/graphical.nix index cebc17f4..e98244f4 100644 --- a/hosts/orion/modules/graphical.nix +++ b/hosts/orion/modules/graphical.nix @@ -28,13 +28,5 @@ ]; }; }; - hardware.graphics = { - enable = true; - extraPackages = with pkgs; [ - intel-media-driver - intel-vaapi-driver - libvdpau - ]; - }; services.spice-vdagentd.enable = true; } diff --git a/hosts/orion/modules/hardware.nix b/hosts/orion/modules/hardware.nix index 63be4045..ceb20053 100644 --- a/hosts/orion/modules/hardware.nix +++ b/hosts/orion/modules/hardware.nix @@ -1,30 +1,34 @@ +{ pkgs, config, ... }: { - inputs, - lib, - pkgs, - ... -}: - -{ - # NOTE: Disable Nvidia GPU - boot.extraModprobeConfig = '' - blacklist nouveau - options nouveau iwlwifi power_save=1 modeset=0 - ''; - services.udev.extraRules = '' - # Remove NVIDIA USB xHCI Host Controller devices, if present - ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1" - # Remove NVIDIA USB Type-C UCSI devices, if present - ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1" - # Remove NVIDIA Audio devices, if present - ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1" - # Remove NVIDIA VGA/3D controller devices - ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1" - ''; - boot.blacklistedKernelModules = [ - "nouveau" + services.xserver.videoDrivers = [ + "intel" "nvidia" - "nvidia_drm" - "nvidia_modeset" ]; + environment.variables.VDPAU_DRIVER = "va_gl"; + hardware = { + enableRedistributableFirmware = true; + graphics = { + enable = true; + extraPackages = with pkgs; [ + vpl-gpu-rt + intel-media-driver + intel-vaapi-driver + libvdpau-va-gl + nvidia-vaapi-driver + ]; + extraPackages32 = with pkgs.driversi686Linux; [ intel-vaapi-driver ]; + }; + nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.beta; + powerManagement.enable = true; + prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + nvidiaBusId = "PCI:1:0:0"; + intelBusId = "PCI:0:2:0"; + }; + }; + }; }