From 2d3c9a93f7f3e0cb72eb6ae7b3b715a4e0e4d491 Mon Sep 17 00:00:00 2001 From: chn Date: Thu, 7 Mar 2024 20:20:05 +0800 Subject: [PATCH] devices.pc: add amd config --- devices/pc/default.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/devices/pc/default.nix b/devices/pc/default.nix index c6343a53..327d102c 100644 --- a/devices/pc/default.nix +++ b/devices/pc/default.nix @@ -157,6 +157,31 @@ inputs: nixos.hardware.gpu.prime.mode = "sync"; system.nixos.tags = [ "hybrid-sync" ]; }; + amd.configuration = + { + nixos.hardware.gpu = { type = inputs.lib.mkForce "amd"; dynamicBoost = inputs.lib.mkForce false; }; + boot = + { + extraModprobeConfig = + '' + blacklist nouveau + options nouveau modeset=0 + ''; + blacklistedKernelModules = [ "nvidia" "nvidia_drm" "nvidia_modeset" ]; + }; + 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" + ''; + system.nixos.tags = [ "amd" ]; + }; }; }; }