2019-10-19 12:55:35 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
# Graphics drivers
|
|
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
2021-08-04 22:08:30 +02:00
|
|
|
hardware.nvidia.modesetting.enable = true;
|
2019-12-14 12:16:41 +01:00
|
|
|
services.xserver.screenSection = ''
|
2021-08-04 22:08:30 +02:00
|
|
|
Option "metamodes" "1920x1080_120 +0+0 {AllowGSYNC=On, AllowGSYNCCompatible=On, ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"
|
2019-12-14 12:16:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
hardware.opengl = {
|
2021-08-04 22:08:30 +02:00
|
|
|
enable = true;
|
|
|
|
driSupport = true;
|
2019-12-14 12:16:41 +01:00
|
|
|
driSupport32Bit = true;
|
2020-09-23 13:19:19 +02:00
|
|
|
extraPackages = with pkgs; [ libvdpau-va-gl vaapiVdpau ];
|
2021-08-04 22:08:30 +02:00
|
|
|
extraPackages32 = with pkgs.pkgsi686Linux; [ libvdpau-va-gl vaapiVdpau ];
|
2019-12-14 12:16:41 +01:00
|
|
|
};
|
2021-11-09 09:57:22 +01:00
|
|
|
|
|
|
|
# NVIDIA GBM setup
|
|
|
|
environment.variables = {
|
|
|
|
GBM_BACKENDS_PATH = "/run/opengl-driver/lib/gbm";
|
|
|
|
GBM_BACKEND = "nvidia-drm";
|
|
|
|
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
|
|
|
OCL_ICD_VENDORS = "/run/opengl-driver/etc/OpenCL/vendors";
|
|
|
|
};
|
2019-10-19 12:55:35 +02:00
|
|
|
}
|