2024-06-24 11:38:28 -04:00
|
|
|
# Enables Intel GPU support.
|
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
cfg = config.aux.system.gpu.intel;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
2024-09-08 11:58:56 -04:00
|
|
|
aux.system.gpu.intel.enable = lib.mkEnableOption "Enables Intel GPU support.";
|
2024-06-24 11:38:28 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
# Configuration options from NixOS-Hardware: https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/intel/default.nix
|
|
|
|
boot.initrd.kernelModules = [ "i915" ];
|
|
|
|
|
|
|
|
environment.variables.VDPAU_DRIVER = "va_gl";
|
|
|
|
|
2024-09-08 11:58:56 -04:00
|
|
|
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
|
|
|
|
];
|
2024-06-24 11:38:28 -04:00
|
|
|
|
2024-09-08 11:58:56 -04:00
|
|
|
extraPackages32 = with pkgs.driversi686Linux; [
|
|
|
|
(
|
|
|
|
if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
|
|
|
|
vaapiIntel
|
|
|
|
else
|
|
|
|
intel-vaapi-driver
|
|
|
|
)
|
|
|
|
libvdpau-va-gl
|
|
|
|
intel-media-driver
|
|
|
|
];
|
|
|
|
};
|
2024-06-24 11:38:28 -04:00
|
|
|
};
|
|
|
|
}
|