config/hardware/gpu/intel.nix
2024-07-07 18:07:44 +02:00

33 lines
1.3 KiB
Nix

{ config, pkgs, lib, ... }:
{
# enable opengl (headless)
# https://github.com/NixOS/nixpkgs/blob/nixos-22.11/pkgs/development/libraries/ffmpeg/generic.nix
# https://github.com/NixOS/nixpkgs/blob/nixos-22.11/pkgs/development/libraries/jellyfin-ffmpeg/default.nix
# https://nixos.wiki/wiki/Accelerated_Video_Playback
nixpkgs.config.openglSupport = true; # why is this not set by hardware.opengl.enable ?
nixpkgs.config.vaapiSupport = true;
nixpkgs.config.libaomSupport = true;
nixpkgs.config.vdpauSupport = true; # intel
nixpkgs.config.libmfxSupport = true; # intel
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
};
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
hardware.opengl.extraPackages = with pkgs; [
mesa.drivers
intel-media-driver
(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver)
vaapiVdpau
libvdpau-va-gl
intel-ocl
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
(pkgs.nvtopPackages.intel or pkgs.nvtop-intel)
];
}