feat: move amdgpu-specific config to its own role, since i now also have nvidia systems

This commit is contained in:
Ahwx 2025-03-24 09:24:17 +01:00
parent 2a03321fa7
commit 5da047a5c9
3 changed files with 33 additions and 15 deletions

31
roles/amdgpu.nix Normal file
View file

@ -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
];
};
}

View file

@ -2,6 +2,8 @@
{
imports =
[(import ./laptop.nix)]
++ [(import ./amdgpu.nix)]
++ [(import ./nvidia.nix)]
++ [(import ./desktop.nix)]
++ [(import ./creative.nix)];
}