From fe57eebacda44d73fbecd4071a35919e01e40117 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Mon, 22 Jul 2024 19:50:46 +0300 Subject: [PATCH] feat(roles/amdgpu, hosts/arwen): amdgpu role --- hosts/arwen/default.nix | 1 + roles/amdgpu.nix | 24 ++++++++++++++++++++++++ roles/default.nix | 1 + 3 files changed, 26 insertions(+) create mode 100644 roles/amdgpu.nix diff --git a/hosts/arwen/default.nix b/hosts/arwen/default.nix index f40d1d1..689aa78 100644 --- a/hosts/arwen/default.nix +++ b/hosts/arwen/default.nix @@ -37,6 +37,7 @@ roles.zellij.enable = true; roles.kitty.enable = true; + roles.amdgpu.enable = true; roles.hyprland.enable = true; roles.gaming = { diff --git a/roles/amdgpu.nix b/roles/amdgpu.nix new file mode 100644 index 0000000..830b8b4 --- /dev/null +++ b/roles/amdgpu.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + ... +}: let + cfg = config.roles.amdgpu; +in { + options.roles.amdgpu = { + enable = lib.mkEnableOption "AMDGPU drivers"; + }; + + + config = lib.mkIf cfg.enable { + boot.initrd.kernelModules = ["amdgpu"]; + + services.xserver.videoDrivers = ["amdgpu"]; + + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + }; +} diff --git a/roles/default.nix b/roles/default.nix index a3c1a5d..7266cae 100644 --- a/roles/default.nix +++ b/roles/default.nix @@ -3,6 +3,7 @@ ./gaming ./shell + ./amdgpu.nix # FIXME: merge with nvidia.nix to graphics/ role ./audio.nix ./bluetooth.nix ./base.nix -- 2.44.1