From 9f65c5c4a01c4a7c30e09685e63a22579f2ff494 Mon Sep 17 00:00:00 2001 From: ooks-io Date: Sun, 31 Mar 2024 19:54:24 +1300 Subject: [PATCH] feat(amd): add initial amd gpu module --- system/profiles/amd/default.nix | 29 +++++++++++++++++++++++++++++ system/profiles/default.nix | 4 ++++ 2 files changed, 33 insertions(+) create mode 100644 system/profiles/amd/default.nix diff --git a/system/profiles/amd/default.nix b/system/profiles/amd/default.nix new file mode 100644 index 0000000..77a32f7 --- /dev/null +++ b/system/profiles/amd/default.nix @@ -0,0 +1,29 @@ +{ lib, config, pkgs, ... }: + +let + cfg = config.systemProfile.amd; +in + +{ + config = lib.mkIf cfg.enable { + + hardware.opengl = { + extraPackages = with pkgs; [ + vulkan-tools + vulkan-loader + vulkan-extension-layer + vulkan-validation-layer + amdvlk + mesa + ]; + extraPackages32 = [ pkgs.driversi686Linux.amdvlk ]; + }; + + boot = { + initrd.kernelModules = ["amdgpu"]; + kernelModules = ["amdgpu"]; + }; + + environment.systemPackages = [ pkgs.nvtopPackages.amd ]; + }; +} diff --git a/system/profiles/default.nix b/system/profiles/default.nix index a38f82b..ed2187f 100644 --- a/system/profiles/default.nix +++ b/system/profiles/default.nix @@ -13,6 +13,7 @@ in ./gaming ./laptop ./mediaServer + ./amd ]; options = { @@ -34,6 +35,9 @@ in nvidia = { enable = lib.mkEnableOption "Enable the nvidia profile"; }; + amd = { + enable = lib.mkEnableOption "Enable the amd profile"; + }; mediaServer = { enable = lib.mkEnableOption "Enable the mediaServer profile"; };