60 lines
1.8 KiB
Nix
60 lines
1.8 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
{
|
|
|
|
# Enable OpenGL
|
|
hardware.graphics = {
|
|
enable = true;
|
|
};
|
|
|
|
# Load nvidia driver for Xorg and Wayland
|
|
services.xserver.videoDrivers = ["nvidia"];
|
|
|
|
# specify nvidia driver version
|
|
hardware.nvidia = {
|
|
|
|
# Modesetting is required.
|
|
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 = false;
|
|
|
|
# Fine-grained power management. Turns off GPU when not in use.
|
|
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
|
powerManagement.finegrained = false;
|
|
|
|
# the open source drivers are not compatible with the old 1050ti
|
|
open = false;
|
|
|
|
# Enable the Nvidia settings menu,
|
|
# accessible via `nvidia-settings`.
|
|
nvidiaSettings = true;
|
|
|
|
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
|
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
|
|
version = "565.77"; # latest
|
|
sha256_64bit = "sha256-CnqnQsRrzzTXZpgkAtF7PbH9s7wbiTRNcM0SPByzFHw=";
|
|
sha256_aarch64 = "sha256-LSAYUnhfnK3rcuPe1dixOwAujSof19kNOfdRHE7bToE=";
|
|
openSha256 = "sha256-Fxo0t61KQDs71YA8u7arY+503wkAc1foaa51vi2Pl5I=";
|
|
settingsSha256 = "sha256-VUetj3LlOSz/LB+DDfMCN34uA4bNTTpjDrb6C6Iwukk=";
|
|
persistencedSha256 = "sha256-wnDjC099D8d9NJSp9D0CbsL+vfHXyJFYYgU3CwcqKww=";
|
|
};
|
|
|
|
prime = {
|
|
offload = {
|
|
enable = true;
|
|
enableOffloadCmd = true;
|
|
};
|
|
intelBusId = "PCI:0:2:0";
|
|
nvidiaBusId = "PCI:1:0:0";
|
|
};
|
|
};
|
|
}
|