nixos-config/roles/amdgpu.nix

43 lines
889 B
Nix
Raw Permalink Normal View History

2025-04-08 20:11:16 +02:00
{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.liv.amdgpu;
2025-04-08 20:11:16 +02:00
in
{
options.liv.amdgpu = {
enable = mkEnableOption "Enable amdgpu drivers";
};
config = mkIf cfg.enable {
hardware = {
graphics = {
enable = true;
extraPackages = with pkgs; [
2025-04-07 18:03:31 +02:00
mesa
libva
libvdpau-va-gl
vulkan-loader
vulkan-validation-layers
# amdvlk # error: 'amdvlk' has been removed since it was deprecated by AMD. Its replacement, RADV, is enabled by default.
2025-04-07 18:03:31 +02:00
mesa.opencl
];
extraPackages32 = with pkgs; [
# driversi686Linux.amdvlk # Install amdvlk for 32 bit applications as well
];
};
2025-04-07 18:03:31 +02:00
enableRedistributableFirmware = true;
};
2025-04-08 20:11:16 +02:00
boot.initrd.kernelModules = [ "amdgpu" ];
environment.systemPackages = with pkgs; [
# amdvlk
];
};
}