2023-02-27 12:59:06 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2024-04-07 19:28:11 +00:00
|
|
|
options.hardware.intelgpu.loadInInitrd = lib.mkEnableOption (lib.mdDoc
|
|
|
|
"loading `i195` kernelModule at stage 1. (Add `i915` to `boot.initrd.kernelModules`)"
|
|
|
|
) // {
|
|
|
|
default = true;
|
2023-02-27 12:59:06 +00:00
|
|
|
};
|
|
|
|
|
2024-04-07 19:28:11 +00:00
|
|
|
config = lib.mkMerge [
|
|
|
|
(lib.mkIf config.hardware.intelgpu.loadInInitrd {
|
|
|
|
boot.initrd.kernelModules = [ "i915" ];
|
|
|
|
})
|
|
|
|
{
|
|
|
|
environment.variables = {
|
|
|
|
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl");
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware.opengl.extraPackages = with pkgs; [
|
|
|
|
(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver)
|
|
|
|
libvdpau-va-gl
|
|
|
|
intel-media-driver
|
|
|
|
];
|
|
|
|
}
|
2023-02-27 12:59:06 +00:00
|
|
|
];
|
|
|
|
}
|