mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
feat: move amdgpu-specific config to its own role, since i now also have nvidia systems
This commit is contained in:
parent
2a03321fa7
commit
5da047a5c9
3 changed files with 33 additions and 15 deletions
31
roles/amdgpu.nix
Normal file
31
roles/amdgpu.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
{
|
||||
imports =
|
||||
[(import ./laptop.nix)]
|
||||
++ [(import ./amdgpu.nix)]
|
||||
++ [(import ./nvidia.nix)]
|
||||
++ [(import ./desktop.nix)]
|
||||
++ [(import ./creative.nix)];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue