From defc8e4677936687ea10ed3fbb1d342abdf8249e Mon Sep 17 00:00:00 2001 From: c3r5b8 Date: Sat, 4 Mar 2023 18:39:37 +0200 Subject: [PATCH] Fix disabling Nvidia dGPU --- common/gpu/nvidia/disable.nix | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/common/gpu/nvidia/disable.nix b/common/gpu/nvidia/disable.nix index 72e89c2..83e7d09 100644 --- a/common/gpu/nvidia/disable.nix +++ b/common/gpu/nvidia/disable.nix @@ -4,6 +4,23 @@ # This runs only intel/amdgpu igpus and nvidia dgpus do not drain power. ##### disable nvidia, very nice battery life. - hardware.nvidiaOptimus.disable = lib.mkDefault true; + boot.extraModprobeConfig = lib.mkDefault '' + blacklist nouveau + options nouveau modeset=0 + ''; + + services.udev.extraRules = lib.mkDefault '' + # 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 = lib.mkDefault [ "nouveau" "nvidia" ]; -} +} \ No newline at end of file