|
0
|
1 { pkgs, config, libs, ... }: |
|
|
2 |
|
|
3 { |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 # Enable OpenGL |
|
|
8 hardware.graphics.enable = true; |
|
|
9 |
|
|
10 # Load nvidia driver for Xorg and Wayland |
|
|
11 services.xserver.videoDrivers = ["nvidia"]; |
|
|
12 |
|
|
13 hardware.nvidia = { |
|
|
14 |
|
|
15 # Modesetting is required. |
|
|
16 modesetting.enable = true; |
|
|
17 |
|
|
18 # Nvidia power management. Experimental, and can cause sleep/suspend to fail. |
|
|
19 powerManagement.enable = false; |
|
|
20 # Fine-grained power management. Turns off GPU when not in use. |
|
|
21 # Experimental and only works on modern Nvidia GPUs (Turing or newer). |
|
|
22 powerManagement.finegrained = false; |
|
|
23 |
|
|
24 # Use the NVidia open source kernel module (not to be confused with the |
|
|
25 # independent third-party "nouveau" open source driver). |
|
|
26 # Support is limited to the Turing and later architectures. Full list of |
|
|
27 # supported GPUs is at: |
|
|
28 # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus |
|
|
29 # Only available from driver 515.43.04+ |
|
|
30 # Currently alpha-quality/buggy, so false is currently the recommended setting. |
|
|
31 open = false; |
|
|
32 |
|
|
33 # Enable the Nvidia settings menu, |
|
|
34 # accessible via `nvidia-settings`. |
|
|
35 nvidiaSettings = true; |
|
|
36 |
|
|
37 # Optionally, you may need to select the appropriate driver version for your specific GPU. |
|
|
38 package = config.boot.kernelPackages.nvidiaPackages.stable; |
|
|
39 |
|
|
40 prime = { |
|
|
41 # Make sure to use the correct Bus ID values for your system! |
|
|
42 intelBusId = "PCI:00:02.0"; |
|
|
43 nvidiaBusId = "PCI:01:00.0"; |
|
|
44 }; |
|
|
45 |
|
|
46 }; |
|
|
47 |
|
|
48 } |