niksos/hosts/common/optional/gpu/amd.nix

43 lines
994 B
Nix
Raw Normal View History

2024-02-15 17:04:34 +01:00
{
lib,
2024-02-15 17:04:34 +01:00
pkgs,
...
}: let
inherit (lib.attrsets) attrValues;
in {
2024-09-01 23:31:57 +02:00
# https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/amd/default.nix
services.xserver.videoDrivers = [ "modesetting" ];
2024-02-15 17:04:34 +01:00
hardware = {
2024-09-01 23:31:57 +02:00
amdgpu = {
initrd.enable = true;
opencl.enable = true;
};
graphics = {
2024-02-15 17:04:34 +01:00
enable = true;
enable32Bit = true;
extraPackages = attrValues {
inherit (pkgs)
mesa
libdrm
libva
vaapiVdpau
libvdpau-va-gl
;
};
extraPackages32 = attrValues {
inherit (pkgs.driversi686Linux)
mesa
libvdpau-va-gl
;
};
2024-02-15 17:04:34 +01:00
};
};
2024-02-17 19:56:59 +01:00
boot.initrd.kernelModules = [ "amdgpu" ];
2024-02-17 19:56:59 +01:00
environment.sessionVariables = {
AMD_VULKAN_ICD = "RADV";
};
2024-02-15 17:04:34 +01:00
}