modules - intel and amd drivers

This commit is contained in:
shynd 2025-02-20 15:29:57 +01:00
parent 73a1932596
commit 1b630648cc
2 changed files with 50 additions and 0 deletions

23
modules/amd-drivers.nix Normal file
View File

@ -0,0 +1,23 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.drivers.amdgpu;
in
{
options.drivers.amdgpu = {
enable = mkEnableOption "enable amd drivers";
};
config = mkIf cfg.enable {
systemd.tmpfiles.rules = [ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ];
services.xserver.videoDrivers = [ "amdgpu" ];
# opengl
hardware.graphics = {
extraPackages = with pkgs; [
libva-utils
];
};
};
}

27
modules/intel-drivers.nix Normal file
View File

@ -0,0 +1,27 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.drivers.intel;
in
{
options.drivers.intel = {
enable = mkEnableOption "enable intel graphics drivers";
};
config = mkIf cfg.enable {
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
# opengl
hardware.graphics = {
extraPackages = with pkgs; [
intel-media-driver
libvdpau-media-driver
libva
libva-utils
];
};
};
}