nixos-configuration/modules/hardware/intel.nix

43 lines
945 B
Nix
Raw Normal View History

2023-10-02 17:14:20 +02:00
{
lib,
config,
pkgs,
...
}: let
cfg = config.my.hardware.intel;
in {
options.my.hardware.intel = {
cpu = lib.mkEnableOption "intel cpu";
iGpu = lib.mkEnableOption "intel integrated gpu";
2024-02-05 22:44:35 +01:00
xe = lib.mkEnableOption "intel xe gpu";
2023-10-02 17:14:20 +02:00
};
config = lib.mkMerge [
(lib.mkIf cfg.cpu {
boot.kernelModules = ["kvm-intel"];
hardware.cpu.intel.updateMicrocode = true;
})
2024-02-23 22:30:43 +01:00
(lib.mkIf (cfg.iGpu || cfg.xe) {
2023-10-02 17:14:20 +02:00
hardware.opengl = {
extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
2024-07-21 14:10:13 +02:00
intel-ocl
2023-10-02 17:14:20 +02:00
];
extraPackages32 = with pkgs.pkgsi686Linux; [
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
};
environment.systemPackages = with pkgs; [
2024-06-21 17:13:58 +02:00
nvtopPackages.intel
2023-10-02 17:14:20 +02:00
];
2024-07-21 14:10:13 +02:00
my.allowUnfreePackages = ["intel-ocl"];
2023-10-02 17:14:20 +02:00
})
];
}