2024-06-24 11:38:28 -04:00
|
|
|
# Enables AMD GPU support.
|
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
cfg = config.aux.system.gpu.amd;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
aux.system.gpu.amd.enable = lib.mkEnableOption (lib.mdDoc "Enables AMD GPU support.");
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
|
|
|
services.xserver = {
|
|
|
|
enable = true;
|
|
|
|
videoDrivers = [ "amdgpu" ];
|
|
|
|
};
|
|
|
|
|
2024-06-24 12:24:21 -04:00
|
|
|
hardware.graphics = {
|
2024-06-24 11:38:28 -04:00
|
|
|
extraPackages = [ pkgs.amdvlk ];
|
|
|
|
# 32-bit application compatibility
|
2024-06-24 12:24:21 -04:00
|
|
|
enable32Bit = true;
|
2024-06-24 11:38:28 -04:00
|
|
|
extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|