2024-02-08 23:21:10 +03:00
|
|
|
{ pkgs, config, ... }:
|
2021-02-07 02:38:11 +03:00
|
|
|
with config.deviceSpecific; {
|
2019-08-27 23:41:02 +04:00
|
|
|
|
2021-02-07 02:38:11 +03:00
|
|
|
hardware.cpu.${devInfo.cpu.vendor}.updateMicrocode = true;
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
2019-08-27 23:41:02 +04:00
|
|
|
|
2019-09-14 22:12:56 +04:00
|
|
|
hardware.opengl = {
|
|
|
|
enable = true;
|
|
|
|
driSupport = true;
|
|
|
|
driSupport32Bit = true;
|
2021-02-07 02:38:11 +03:00
|
|
|
extraPackages = if devInfo.gpu.vendor == "intel" then [
|
2019-09-14 22:12:56 +04:00
|
|
|
pkgs.intel-media-driver
|
2023-10-13 19:51:59 +03:00
|
|
|
pkgs.intel-vaapi-driver
|
|
|
|
pkgs.libvdpau-va-gl
|
2021-09-07 11:56:15 +03:00
|
|
|
] else if devInfo.gpu.vendor == "amd" then [
|
2023-07-26 21:21:48 +03:00
|
|
|
pkgs.rocm-opencl-icd
|
|
|
|
pkgs.rocm-opencl-runtime
|
2019-09-14 22:12:56 +04:00
|
|
|
] else [ ];
|
|
|
|
};
|
2022-10-08 04:38:45 +03:00
|
|
|
environment.sessionVariables = if (devInfo.gpu.vendor == "intel") then {
|
2019-09-17 02:26:38 +04:00
|
|
|
GST_VAAPI_ALL_DRIVERS = "1";
|
|
|
|
LIBVA_DRIVER_NAME = "iHD";
|
2023-10-13 19:51:59 +03:00
|
|
|
VDPAU_DRIVER = "va_gl";
|
2022-10-08 04:38:45 +03:00
|
|
|
} else if (devInfo.gpu.vendor == "amd") then {
|
|
|
|
AMD_VULKAN_ICD = "RADV";
|
|
|
|
} else {};
|
2021-09-07 11:56:15 +03:00
|
|
|
boot.initrd.kernelModules = if devInfo.gpu.vendor == "amd" then [
|
|
|
|
"amdgpu"
|
|
|
|
] else if devInfo.gpu.vendor == "intel" then [
|
2021-10-30 21:04:53 +03:00
|
|
|
"i915"
|
2021-09-07 11:56:15 +03:00
|
|
|
] else [ ];
|
2019-08-27 23:41:02 +04:00
|
|
|
}
|