1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-12-19 08:09:45 +01:00

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,15 +1,26 @@
{ 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`)"
environment.variables = { ) // {
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl"); default = true;
}; };
hardware.opengl.extraPackages = with pkgs; [ config = lib.mkMerge [
(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver) (lib.mkIf config.hardware.intelgpu.loadInInitrd {
libvdpau-va-gl boot.initrd.kernelModules = [ "i915" ];
intel-media-driver })
{
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
];
}
]; ];
} }