diff --git a/modules/core/hardware.nix b/modules/core/hardware.nix index c727176..1f1523c 100644 --- a/modules/core/hardware.nix +++ b/modules/core/hardware.nix @@ -1,18 +1,3 @@ { pkgs, ... }: { - hardware = { - graphics = { - enable = true; - }; - enableRedistributableFirmware = true; - opengl = { - extraPackages = with pkgs; [ - amdvlk - ]; - # For 32 bit applications as well - extraPackages32 = with pkgs; [ - driversi686Linux.amdvlk - ]; - }; - }; } diff --git a/roles/amdgpu.nix b/roles/amdgpu.nix new file mode 100644 index 0000000..8d017f1 --- /dev/null +++ b/roles/amdgpu.nix @@ -0,0 +1,31 @@ +{ lib, pkgs, config, ... }: +with lib; +let + cfg = config.liv.amdgpu; +in { + options.liv.amdgpu = { + enable = mkEnableOption "Enable amdgpu drivers"; + }; + + config = mkIf cfg.enable { + hardware = { + graphics = { + enable = true; + }; + enableRedistributableFirmware = true; + opengl = { + extraPackages = with pkgs; [ + amdvlk + ]; + # For 32 bit applications as well + extraPackages32 = with pkgs; [ + driversi686Linux.amdvlk + ]; + }; + }; + + environment.systemPackages = with pkgs; [ + amdvlk + ]; + }; +} diff --git a/roles/default.nix b/roles/default.nix index 48842f5..b89d962 100644 --- a/roles/default.nix +++ b/roles/default.nix @@ -2,6 +2,8 @@ { imports = [(import ./laptop.nix)] + ++ [(import ./amdgpu.nix)] + ++ [(import ./nvidia.nix)] ++ [(import ./desktop.nix)] ++ [(import ./creative.nix)]; }