common/gpu/intel: Make initrd - i915 an option
This commit is contained in:
parent
797f8d8082
commit
0335d1a093
|
@ -1,15 +1,26 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
boot.initrd.kernelModules = [ "i915" ];
|
||||
|
||||
environment.variables = {
|
||||
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl");
|
||||
options.hardware.intelgpu.loadInInitrd = lib.mkEnableOption (lib.mdDoc
|
||||
"loading `i195` kernelModule at stage 1. (Add `i915` to `boot.initrd.kernelModules`)"
|
||||
) // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
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
|
||||
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
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue