mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
hardware/graphics: init from legacy
This commit is contained in:
parent
28b35bdd1c
commit
55964e1622
5 changed files with 41 additions and 20 deletions
|
@ -5,6 +5,7 @@
|
|||
imports = [
|
||||
./bluetooth
|
||||
./firmware
|
||||
./graphics
|
||||
./keychron
|
||||
./nitrokey
|
||||
./sound
|
||||
|
|
32
modules/hardware/graphics/default.nix
Normal file
32
modules/hardware/graphics/default.nix
Normal 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
|
||||
];
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue