diff --git a/modules/system/hardware/graphics/amdgpu.nix b/modules/system/hardware/graphics/amdgpu.nix new file mode 100644 index 0000000..0632943 --- /dev/null +++ b/modules/system/hardware/graphics/amdgpu.nix @@ -0,0 +1,27 @@ +{ config, lib, ... }: + +with lib; +let + cfg = config.modules.system.hardware.graphics.amdgpu; +in +{ + options.modules.system.hardware.graphics.amdgpu = { + enable = mkEnableOption '' + Enable amdgpu with my custom configurations + ''; + }; + config = mkIf cfg.enable { + boot.initrd.kernelModules = [ "amdgpu" ]; + # Load amdgpu driver for Xorg and Wayland + services.xserver = { + enable = true; + videoDrivers = ["amdgpu"]; + }; + + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = with pkgs; [ rocmPackages.clr.icd ]; + }; + }; +} diff --git a/modules/system/hardware/graphics/default.nix b/modules/system/hardware/graphics/default.nix index 955883d..7fa6bf6 100644 --- a/modules/system/hardware/graphics/default.nix +++ b/modules/system/hardware/graphics/default.nix @@ -2,6 +2,7 @@ { imports = [ + ./amdgpu.nix ./nvidia.nix ]; } \ No newline at end of file