nix-conf/modules/nixos/hardware/default.nix
2024-04-12 12:45:13 +05:30

25 lines
702 B
Nix

{
config,
lib,
pkgs,
...
}: {
options = {
hardware.enable = lib.mkEnableOption "enable hardware options";
};
config = lib.mkIf config.hardware.enable {
environment.sessionVariables = {LIBVA_DRIVER_NAME = "iHD";};
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [vaapiIntel vaapiVdpau libvdpau-va-gl intel-media-driver intel-vaapi-driver];
};
};
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
intel-vaapi-driver = pkgs.intel-vaapi-driver.override {enableHybridCodec = true;};
};
};
}