-
Notifications
You must be signed in to change notification settings - Fork 0
/
nvidia.nix
34 lines (27 loc) · 985 Bytes
/
nvidia.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ config, lib, pkgs, ... }:
{
# Make sure opengl is enabled
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Tell Xorg to use the nvidia driver (also valid for Wayland)
# Though wayland sucks for nvidia so...
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia.modesetting.enable = true;
hardware.nvidia = {
# Modesetting is needed for most Wayland compositors
modesetting.enable = true;
# Use the open source version of the kernel module
# Only available on driver 515.43.04+
open = false;
# Enable the nvidia settings menu
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
hardware.nvidia.powerManagement.enable = true;
virtualisation.podman.enableNvidia = true;
}