flake/nixos/modules/hardware/components/gpu/intel.nix

35 lines
949 B
Nix
Raw Normal View History

{
lib,
config,
pkgs,
...
}: let
2023-12-15 18:40:18 +00:00
cfg = config.myFlake.hardware.components.gpu.intel;
in {
options = {
2023-12-15 18:40:18 +00:00
myFlake.hardware.components.gpu.intel.enable = lib.mkEnableOption "Whether to enable Intel GPU.";
};
# 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;};};
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)
vaapiVdpau
libvdpau-va-gl
intel-compute-runtime # intel opencl
intel-media-driver # intel vaapi
];
extraPackages32 = with pkgs; [pkgsi686Linux.vaapiIntel];
};
};
}