From ee9f3111de794319efb7cb7a60846b09346f5791 Mon Sep 17 00:00:00 2001 From: Drew Haven Date: Sat, 29 Mar 2025 10:57:54 -0700 Subject: [PATCH] [mcp] Adds nvidia drivers --- system/hosts/mcp/hardware-configuration.nix | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/system/hosts/mcp/hardware-configuration.nix b/system/hosts/mcp/hardware-configuration.nix index e70d780..b9c5f55 100644 --- a/system/hosts/mcp/hardware-configuration.nix +++ b/system/hosts/mcp/hardware-configuration.nix @@ -35,4 +35,33 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + # Graphics settings + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.nvidia = { + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = true; + + # Fine-grained power management for PRIME. Turns off GPU when not in use. + # Experimental and only works on modern Nvidia GPUs (Turing or newer). + # Requires offload to be enabled. + # powerManagement.finegrained = false; + + # Use the open-source driver? + open = false; + + # Enable the nvidia-settings menu? + nvidiaSettings = true; + }; }