mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-12-26 03:29:44 +01:00
4677bf5e89
the existing drivers should provide video accelerations since broadwell. This driver also caused a crash in the past in VLC: https://github.com/NixOS/nixpkgs/issues/283083
63 lines
1.5 KiB
Nix
63 lines
1.5 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
{
|
|
imports = [ ../24.05-compat.nix ];
|
|
options.hardware.intelgpu.driver = lib.mkOption {
|
|
description = "Intel GPU driver to use";
|
|
type = lib.types.enum [
|
|
"i915"
|
|
"xe"
|
|
];
|
|
default = "i915";
|
|
};
|
|
|
|
options.hardware.intelgpu.loadInInitrd =
|
|
lib.mkEnableOption (
|
|
lib.mdDoc "Load the Intel GPU kernel module at stage 1 boot. (Added to `boot.initrd.kernelModules`)"
|
|
)
|
|
// {
|
|
default = true;
|
|
};
|
|
|
|
config = {
|
|
boot.initrd.kernelModules = [ config.hardware.intelgpu.driver ];
|
|
|
|
environment.variables = {
|
|
VDPAU_DRIVER = lib.mkIf config.hardware.graphics.enable (lib.mkDefault "va_gl");
|
|
};
|
|
|
|
hardware.graphics.extraPackages = with pkgs; [
|
|
(
|
|
if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
|
|
vaapiIntel
|
|
else
|
|
intel-vaapi-driver
|
|
)
|
|
intel-media-driver
|
|
];
|
|
|
|
hardware.graphics.extraPackages32 = with pkgs.driversi686Linux; [
|
|
(
|
|
if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
|
|
vaapiIntel
|
|
else
|
|
intel-vaapi-driver
|
|
)
|
|
intel-media-driver
|
|
];
|
|
|
|
assertions = [
|
|
{
|
|
assertion = (
|
|
config.hardware.intelgpu.driver != "xe"
|
|
|| lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.8"
|
|
);
|
|
message = "Intel Xe GPU driver is not supported on kernels earlier than 6.8. Update or use the i915 driver.";
|
|
}
|
|
];
|
|
};
|
|
}
|