refactor(systemModules): move hardware --> device/hardware, add function option

This commit is contained in:
ooks-io 2024-04-24 23:44:06 +12:00
parent 34ad7d3d61
commit 7679a227ac
17 changed files with 23 additions and 7 deletions

View file

@ -0,0 +1,37 @@
{ config, lib, pkgs, ... }:
let
gpu = config.systemModules.hardware.gpu;
inherit (lib) mkIf;
inherit (builtins) elem;
# vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
in
{
config = mkIf (elem gpu.type ["intel"]) {
services.xserver.videoDrivers = ["modesetting"];
hardware.opengl = {
extraPackages = with pkgs; [
vaapiIntel
vaapiVdpau
libvdpau-va-gl
intel-compute-runtime
intel-media-driver
];
extraPackages32 = with pkgs.pkgsi686Linux; [
vaapiIntel
vaapiVdpau
libvdpau-va-gl
intel-media-driver
];
};
boot.initrd.kernelModules = ["i915"];
environment.variables = mkIf config.hardware.opengl.enable {
VDPAU_DRIVER = "va_gl";
};
};
}