nix-dotfiles/modules/hardware/graphics/amdgpu.nix
2026-04-30 17:15:54 -07:00

27 lines
748 B
Nix

{ pkgs, config, lib, inputs, ... }:
with lib;
let
cfg = config.modules.hardware.graphics.amdgpu;
in {
options.modules.hardware.graphics.amdgpu = {
enable = mkEnableOption "Enable AMD graphics drivers, used in conjuction with nixos-hardware";
overclock = mkEnableOption "Enable overclocking on AMD graphics drivers";
};
config = mkIf cfg.enable {
hardware.amdgpu.opencl.enable = true;
hardware.amdgpu.overdrive.enable = cfg.overclock;
services.lact.enable = cfg.overclock;
environment.systemPackages = with pkgs; [ amdgpu_top ];
environment.variables = {
# radv > amdvlk
AMD_VULKAN_ICD = "RADV";
# hwaccel
LIBVA_DRIVER_NAME = "radeonsi";
VDPAU_DRIVER = "radeonsi";
};
};
}