Files
nixos/modules/system/hardware/gpu/nvidia.nix
T
2026-08-05 18:57:23 +01:00

32 lines
840 B
Nix

{...}: {
# Dedicated NVIDIA GPU (single discrete card, no hybrid/PRIME).
# For Intel+NVIDIA laptops (e.g. the T480), use gpuNvidiaPrime instead.
flake.nixosModules.gpuNvidia = {
config,
pkgs,
...
}: {
services.xserver.videoDrivers = ["nvidia"];
hardware.graphics = {
enable = true;
enable32Bit = true;
};
hardware.nvidia = {
modesetting.enable = true;
# Proprietary kernel modules. Set to true only for Turing+ (RTX 20xx and
# newer) where the open modules are well supported.
open = false;
nvidiaSettings = true;
# Fixes suspend/resume corruption on many setups.
powerManagement.enable = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
environment.systemPackages = with pkgs; [
vulkan-tools
];
};
}