split CPU and GPU from common/cpu/intel

fix #388
This commit is contained in:
Bruno Bigras 2022-03-07 15:20:43 -05:00
parent 850308db3e
commit 53b470587f
5 changed files with 29 additions and 14 deletions

View file

@ -0,0 +1,6 @@
{ config, lib, pkgs, ... }:
{
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,19 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
boot.initrd.kernelModules = [ "i915" ]; imports = [
./cpu-only.nix
environment.variables = { ../../gpu/intel.nix
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl");
};
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.opengl.extraPackages = with pkgs; [
vaapiIntel
vaapiVdpau
libvdpau-va-gl
intel-media-driver
]; ];
} }

15
common/gpu/intel.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
{
boot.initrd.kernelModules = [ "i915" ];
environment.variables = {
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl");
};
hardware.opengl.extraPackages = with pkgs; [
vaapiIntel
libvdpau-va-gl
intel-media-driver
];
}

View file

@ -19,4 +19,8 @@ in
offload.enable = lib.mkDefault true; offload.enable = lib.mkDefault true;
# Hardware should specify the bus ID for intel/nvidia devices # Hardware should specify the bus ID for intel/nvidia devices
}; };
hardware.opengl.extraPackages = with pkgs; [
vaapiVdpau
];
} }

View file

@ -121,6 +121,7 @@
common-cpu-amd = import ./common/cpu/amd; common-cpu-amd = import ./common/cpu/amd;
common-cpu-intel = import ./common/cpu/intel; common-cpu-intel = import ./common/cpu/intel;
common-cpu-intel-cpu-only = import ./common/cpu/intel/cpu-only;
common-cpu-intel-kaby-lake = import ./common/cpu/intel/kaby-lake; common-cpu-intel-kaby-lake = import ./common/cpu/intel/kaby-lake;
common-cpu-intel-sandy-bridge = import ./common/cpu/intel/sandy-bridge; common-cpu-intel-sandy-bridge = import ./common/cpu/intel/sandy-bridge;
common-gpu-amd = import ./common/gpu/amd; common-gpu-amd = import ./common/gpu/amd;