convert nvidia-optimus.nix to specialisation

This commit is contained in:
NullBite 2023-12-28 01:03:46 -05:00
parent a22acd6a9e
commit 973a31859d
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -3,20 +3,14 @@
{ {
services.supergfxd.enable = true; services.supergfxd.enable = true;
specialisation = {
nvidia.configuration = {
system.nixos.tags = [ "NVIDIA" ]
# Load nvidia driver for Xorg and Wayland # Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["amdgpu" "nvidia"]; services.xserver.videoDrivers = ["amdgpu" "nvidia"];
hardware.nvidia = { hardware.nvidia = {
# Modesetting is required.
modesetting.enable = false;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the # Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver). # independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of # Support is limited to the Turing and later architectures. Full list of
@ -41,6 +35,7 @@
amdgpuBusId = "PCI:07:00:0"; amdgpuBusId = "PCI:07:00:0";
nvidiaBusId = "PCI:01:00:0"; nvidiaBusId = "PCI:01:00:0";
}; };
}
};
}; };
} }