hardware/graphics: init from legacy

This commit is contained in:
Felix Buehler 2023-03-19 14:42:42 +01:00
parent 28b35bdd1c
commit 55964e1622
5 changed files with 41 additions and 20 deletions

View file

@ -5,6 +5,7 @@
imports = [
./bluetooth
./firmware
./graphics
./keychron
./nitrokey
./sound

View file

@ -0,0 +1,32 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.hardware.graphics;
in
{
options.my.hardware.graphics = with lib; {
cpuFlavor = mkOption {
type = with types; nullOr (enum [ "intel" ]);
default = null;
example = "intel";
description = "Which kind of GPU";
};
};
config = lib.mkMerge [
# Intel GPU
(lib.mkIf (cfg.cpuFlavor == "intel") {
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
vaapiVdpau
libvdpau-va-gl
];
};
})
];
}