nix-dotfiles/modules/hardware/graphics/amdgpu.nix

27 lines
714 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 {
# opencl
hardware.amdgpu.opencl.enable = true;
nixpkgs.config.rocmSupport = true;
# oc
hardware.amdgpu.overdrive.enable = cfg.overclock;
services.lact.enable = cfg.overclock;
# top
environment.systemPackages = with pkgs; [ amdgpu_top ];
# radv > amdvlk
environment.variables.AMD_VULKAN_ICD = "RADV";
};
}