From 53b470587f45fc6ca0685994221da3cc0e363741 Mon Sep 17 00:00:00 2001 From: Bruno Bigras Date: Mon, 7 Mar 2022 15:20:43 -0500 Subject: [PATCH 1/2] split CPU and GPU from common/cpu/intel fix #388 --- common/cpu/intel/cpu-only.nix | 6 ++++++ common/cpu/intel/default.nix | 17 +++-------------- common/gpu/intel.nix | 15 +++++++++++++++ common/gpu/nvidia.nix | 4 ++++ flake.nix | 1 + 5 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 common/cpu/intel/cpu-only.nix create mode 100644 common/gpu/intel.nix diff --git a/common/cpu/intel/cpu-only.nix b/common/cpu/intel/cpu-only.nix new file mode 100644 index 0000000..f48b036 --- /dev/null +++ b/common/cpu/intel/cpu-only.nix @@ -0,0 +1,6 @@ +{ config, lib, pkgs, ... }: + +{ + hardware.cpu.intel.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/common/cpu/intel/default.nix b/common/cpu/intel/default.nix index 273360d..966505f 100644 --- a/common/cpu/intel/default.nix +++ b/common/cpu/intel/default.nix @@ -1,19 +1,8 @@ { config, lib, pkgs, ... }: { - boot.initrd.kernelModules = [ "i915" ]; - - environment.variables = { - 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 + imports = [ + ./cpu-only.nix + ../../gpu/intel.nix ]; } diff --git a/common/gpu/intel.nix b/common/gpu/intel.nix new file mode 100644 index 0000000..31db8b4 --- /dev/null +++ b/common/gpu/intel.nix @@ -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 + ]; +} diff --git a/common/gpu/nvidia.nix b/common/gpu/nvidia.nix index fed9fa9..365dbfa 100644 --- a/common/gpu/nvidia.nix +++ b/common/gpu/nvidia.nix @@ -19,4 +19,8 @@ in offload.enable = lib.mkDefault true; # Hardware should specify the bus ID for intel/nvidia devices }; + + hardware.opengl.extraPackages = with pkgs; [ + vaapiVdpau + ]; } diff --git a/flake.nix b/flake.nix index 990f44f..2d12198 100644 --- a/flake.nix +++ b/flake.nix @@ -121,6 +121,7 @@ common-cpu-amd = import ./common/cpu/amd; 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-sandy-bridge = import ./common/cpu/intel/sandy-bridge; common-gpu-amd = import ./common/gpu/amd; From bb8b3f19e041747d9ad45a83ac6b07093720833d Mon Sep 17 00:00:00 2001 From: Bruno Bigras Date: Tue, 12 Apr 2022 11:17:21 -0400 Subject: [PATCH 2/2] Update flake.nix Co-authored-by: amesgen --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 2d12198..53f1d7d 100644 --- a/flake.nix +++ b/flake.nix @@ -121,7 +121,7 @@ common-cpu-amd = import ./common/cpu/amd; common-cpu-intel = import ./common/cpu/intel; - common-cpu-intel-cpu-only = import ./common/cpu/intel/cpu-only; + common-cpu-intel-cpu-only = import ./common/cpu/intel/cpu-only.nix; common-cpu-intel-kaby-lake = import ./common/cpu/intel/kaby-lake; common-cpu-intel-sandy-bridge = import ./common/cpu/intel/sandy-bridge; common-gpu-amd = import ./common/gpu/amd;