forked from aylac.top/nixcfg
this repo has no description
at main 1.7 kB view raw
1{ 2 config, 3 lib, 4 ... 5}: { 6 options.myHardware.nvidia.gpu.enable = lib.mkEnableOption "Use the NVIDIA proprietary GPU drivers."; 7 8 config = lib.mkIf config.myHardware.nvidia.gpu.enable { 9 # Load nvidia driver for Xorg and Wayland 10 services.xserver.videoDrivers = [ 11 "modesetting" 12 "nvidia" 13 ]; 14 15 # Enable OpenGL 16 hardware = { 17 graphics = { 18 enable = true; 19 enable32Bit = true; 20 }; 21 22 nvidia = { 23 # Modesetting is required. 24 modesetting.enable = true; 25 26 # Nvidia power management. Experimental, and can cause sleep/suspend to fail. 27 # Enable this if you have graphical corruption issues or application crashes after waking 28 # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead 29 # of just the bare essentials. 30 powerManagement.enable = false; 31 32 # Use the NVidia open source kernel module (not to be confused with the 33 # independent third-party "nouveau" open source driver). 34 # Support is limited to the Turing and later architectures. Full list of 35 # supported GPUs is at: 36 # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus 37 # Only available from driver 515.43.04+ 38 open = false; 39 40 # Enable the Nvidia settings menu, 41 # accessible via `nvidia-settings`. 42 nvidiaSettings = true; 43 44 # Optionally, you may need to select the appropriate driver version for your specific GPU. 45 package = config.boot.kernelPackages.nvidiaPackages.stable; 46 47 prime.offload = { 48 enable = true; 49 enableOffloadCmd = true; 50 }; 51 }; 52 }; 53 }; 54}