35 lines
992 B
Nix
35 lines
992 B
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
hardware.graphics = {
|
|
enable = true;
|
|
enable32Bit = true;
|
|
};
|
|
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
|
|
|
boot.initrd.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
|
|
boot.kernelParams = [
|
|
"nvidia-drm.modeset=1"
|
|
"nvidia-drm.fbdev=1"
|
|
];
|
|
|
|
hardware.nvidia = {
|
|
modesetting.enable = true;
|
|
powerManagement.enable = true;
|
|
powerManagement.finegrained = lib.mkDefault false;
|
|
open = lib.mkDefault true;
|
|
nvidiaSettings = true;
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
};
|
|
|
|
# NVIDIA-specific session variables live here so machines without
|
|
# NVIDIA GPUs (which do not import this module) stay vendor-clean.
|
|
environment.sessionVariables = {
|
|
LIBVA_DRIVER_NAME = "nvidia";
|
|
GBM_BACKEND = "nvidia-drm";
|
|
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
|
NVD_BACKEND = "direct";
|
|
};
|
|
}
|