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