2023-02-25 04:39:30 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
2024-10-30 23:18:53 +01:00
|
|
|
lib.mkMerge [
|
|
|
|
|
2023-02-25 04:39:30 +01:00
|
|
|
{
|
|
|
|
# enable opengl (headless)
|
|
|
|
|
2023-03-03 02:24:07 +01:00
|
|
|
# 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
|
2024-01-10 23:49:21 +01:00
|
|
|
# https://nixos.wiki/wiki/Accelerated_Video_Playback
|
2023-03-03 02:24:07 +01:00
|
|
|
|
|
|
|
nixpkgs.config.openglSupport = true; # why is this not set by hardware.opengl.enable ?
|
2023-03-03 21:42:29 +01:00
|
|
|
nixpkgs.config.vaapiSupport = true;
|
2023-03-03 02:24:07 +01:00
|
|
|
nixpkgs.config.libaomSupport = true;
|
2023-03-03 21:42:29 +01:00
|
|
|
nixpkgs.config.vdpauSupport = true; # intel
|
|
|
|
nixpkgs.config.libmfxSupport = true; # intel
|
2023-03-03 02:24:07 +01:00
|
|
|
|
2024-01-10 23:49:21 +01:00
|
|
|
nixpkgs.config.packageOverrides = pkgs: {
|
|
|
|
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
|
|
|
|
intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
|
|
|
|
};
|
|
|
|
|
2023-02-25 04:39:30 +01:00
|
|
|
hardware.opengl.enable = true;
|
2024-10-30 23:18:53 +01:00
|
|
|
}
|
|
|
|
(lib.optionalAttrs (lib.versionOlder (lib.versions.majorMinor lib.version) "24.11") {
|
2023-06-24 14:48:53 +02:00
|
|
|
hardware.opengl.driSupport = true;
|
2024-10-30 23:18:53 +01:00
|
|
|
})
|
|
|
|
{
|
2023-03-11 03:39:06 +01:00
|
|
|
hardware.opengl.extraPackages = with pkgs; [
|
|
|
|
mesa.drivers
|
2024-01-10 23:49:21 +01:00
|
|
|
intel-media-driver
|
2024-10-23 00:24:27 +02:00
|
|
|
# not added due to collision
|
|
|
|
# https://github.com/NixOS/nixos-hardware/issues/1170
|
|
|
|
#(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11")
|
|
|
|
# then vaapiIntel
|
|
|
|
# else intel-vaapi-driver)
|
2023-03-11 03:39:06 +01:00
|
|
|
vaapiVdpau
|
2024-01-10 23:49:21 +01:00
|
|
|
libvdpau-va-gl
|
2023-03-11 03:39:06 +01:00
|
|
|
intel-ocl
|
2024-01-10 23:49:21 +01:00
|
|
|
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
|
2024-06-20 20:54:49 +02:00
|
|
|
(pkgs.nvtopPackages.intel or pkgs.nvtop-intel)
|
2023-03-11 03:39:06 +01:00
|
|
|
];
|
2023-02-25 04:39:30 +01:00
|
|
|
}
|
2024-10-30 23:18:53 +01:00
|
|
|
]
|