1
0
Fork 0
nix-configuration/modules/system/gpu/intel.nix

47 lines
1 KiB
Nix
Raw Normal View History

# 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.";
};
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-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
];
};
};
}