2023-11-25 17:13:46 -05:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
2024-01-16 23:51:28 -05:00
|
|
|
# FIXME: move this to hardware-config?
|
|
|
|
|
2023-10-17 17:53:10 -04:00
|
|
|
# Enable OpenGL
|
|
|
|
hardware.opengl = {
|
|
|
|
enable = true;
|
|
|
|
driSupport = true;
|
|
|
|
driSupport32Bit = true;
|
2023-11-25 03:24:12 -05:00
|
|
|
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
vaapiVdpau
|
|
|
|
];
|
2023-10-17 17:53:10 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
# Load nvidia driver for Xorg and Wayland
|
|
|
|
services.xserver.videoDrivers = ["nvidia"];
|
|
|
|
|
|
|
|
hardware.nvidia = {
|
|
|
|
modesetting.enable = true;
|
|
|
|
|
|
|
|
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
|
|
|
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;
|
|
|
|
|
2024-01-14 18:32:32 -05:00
|
|
|
# FIXME: https://github.com/NVIDIA/open-gpu-kernel-modules/pull/589
|
|
|
|
open = false;
|
2023-10-17 17:53:10 -04:00
|
|
|
|
|
|
|
# Enable the Nvidia settings menu,
|
2023-11-22 15:33:16 -05:00
|
|
|
# accessible via `nvidia-settings`.
|
2023-10-17 17:53:10 -04:00
|
|
|
nvidiaSettings = true;
|
|
|
|
|
2024-01-14 18:32:32 -05:00
|
|
|
# Vulkan is much more stable in Wayland
|
2023-12-15 19:30:14 -05:00
|
|
|
package = config.boot.kernelPackages.nvidiaPackages.vulkan_beta;
|
2023-10-17 17:53:10 -04:00
|
|
|
};
|
|
|
|
}
|