2023-11-17 07:17:12 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2023-12-15 18:40:18 +00:00
|
|
|
cfg = config.myFlake.hardware.components.gpu.intel;
|
2023-11-17 07:17:12 +00:00
|
|
|
in {
|
|
|
|
options = {
|
2023-12-15 18:40:18 +00:00
|
|
|
myFlake.hardware.components.gpu.intel.enable = lib.mkEnableOption "Whether to enable Intel GPU.";
|
2023-11-17 07:17:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# https://nixos.wiki/wiki/Intel_Graphics
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
hardware.opengl = {
|
|
|
|
enable = true;
|
|
|
|
driSupport = true;
|
|
|
|
driSupport32Bit = true;
|
|
|
|
};
|
|
|
|
|
2023-11-25 07:44:55 +00:00
|
|
|
nixpkgs.config.packageOverrides = pkgs: {vaapiIntel = pkgs.intel-vaapi-driver.override {enableHybridCodec = true;};};
|
2023-11-17 07:17:12 +00:00
|
|
|
hardware.opengl = {
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
intel-media-driver # libva_driver_name=ihd
|
2023-11-25 07:44:55 +00:00
|
|
|
intel-vaapi-driver # libva_driver_name=i965 (older but works better for firefox/chromium)
|
2023-11-17 07:17:12 +00:00
|
|
|
vaapiVdpau
|
|
|
|
libvdpau-va-gl
|
|
|
|
intel-compute-runtime # intel opencl
|
|
|
|
intel-media-driver # intel vaapi
|
|
|
|
];
|
|
|
|
extraPackages32 = with pkgs; [pkgsi686Linux.vaapiIntel];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|