···2929 ];
30303131 nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
3232- hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
3232+ hardware.graphics = {
3333+ enable = true;
3434+ };
3535+3636+ # Load nvidia driver for Xorg and Wayland
3737+ services.xserver.videoDrivers = ["nvidia"];
3838+3939+ hardware.nvidia = {
4040+ # Modesetting is required.
4141+ modesetting.enable = true;
4242+4343+ # Nvidia power management. Experimental, and can cause sleep/suspend to fail.
4444+ # Enable this if you have graphical corruption issues or application crashes after waking
4545+ # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
4646+ # of just the bare essentials.
4747+ powerManagement.enable = false;
4848+4949+ # Fine-grained power management. Turns off GPU when not in use.
5050+ # Experimental and only works on modern Nvidia GPUs (Turing or newer).
5151+ powerManagement.finegrained = false;
5252+5353+ # Enable the Nvidia settings menu,
5454+ # accessible via `nvidia-settings`.
5555+ nvidiaSettings = true;
5656+5757+ open = false;
5858+5959+ prime = {
6060+ amdgpuBusId = "PCI:6:0:0";
6161+ nvidiaBusId = "PCI:1:0:0";
6262+ };
6363+6464+ # Optionally, you may need to select the appropriate driver version for your specific GPU.
6565+ package = config.boot.kernelPackages.nvidiaPackages.stable;
6666+ };
3367}