common/gpu/intel: Make initrd - i915 an option

This commit is contained in:
Sebastian Sellmeier 2024-04-07 21:28:11 +02:00
parent 797f8d8082
commit 0335d1a093
No known key found for this signature in database
GPG key ID: 51E2BE0CCC826F98

View file

@ -1,8 +1,17 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
boot.initrd.kernelModules = [ "i915" ]; options.hardware.intelgpu.loadInInitrd = lib.mkEnableOption (lib.mdDoc
"loading `i195` kernelModule at stage 1. (Add `i915` to `boot.initrd.kernelModules`)"
) // {
default = true;
};
config = lib.mkMerge [
(lib.mkIf config.hardware.intelgpu.loadInInitrd {
boot.initrd.kernelModules = [ "i915" ];
})
{
environment.variables = { environment.variables = {
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl"); VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl");
}; };
@ -12,4 +21,6 @@
libvdpau-va-gl libvdpau-va-gl
intel-media-driver intel-media-driver
]; ];
}
];
} }