reorganize hardware

This commit is contained in:
Reid 2026-04-30 17:15:54 -07:00
parent 0d9381864c
commit 962e0095ef
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
8 changed files with 76 additions and 54 deletions

View file

@ -1,18 +0,0 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.dev;
in {
options.modules.dev = {
enable = mkEnableOption "General development utilities";
};
config = mkIf cfg.enable {
programs.direnv = {
enable = true;
silent = true;
nix-direnv.enable = true;
};
};
}

View file

@ -0,0 +1,27 @@
{ pkgs, config, lib, inputs, ... }:
with lib;
let
cfg = config.modules.hardware.graphics.amdgpu;
in {
options.modules.hardware.graphics.amdgpu = {
enable = mkEnableOption "Enable AMD graphics drivers, used in conjuction with nixos-hardware";
overclock = mkEnableOption "Enable overclocking on AMD graphics drivers";
};
config = mkIf cfg.enable {
hardware.amdgpu.opencl.enable = true;
hardware.amdgpu.overdrive.enable = cfg.overclock;
services.lact.enable = cfg.overclock;
environment.systemPackages = with pkgs; [ amdgpu_top ];
environment.variables = {
# radv > amdvlk
AMD_VULKAN_ICD = "RADV";
# hwaccel
LIBVA_DRIVER_NAME = "radeonsi";
VDPAU_DRIVER = "radeonsi";
};
};
}

View file

@ -0,0 +1,24 @@
{ pkgs, config, lib, inputs, ... }:
with lib;
let
cfg = config.modules.hardware.graphics.i915;
in {
options.modules.hardware.graphics.i915 = {
enable = mkEnableOption "Enable Intel i915 graphics drivers, used in conjuction with nixos-hardware";
powersave = mkEnableOption {
default = config.modules.core.laptop;
description = "Enable intel i915-specific powersaving tweaks";
};
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ intel-gpu-tools ];
hardware.intel-gpu-tools.enable = true;
boot.kernelParams = [
# enable gpu virtualization
"i915.enable_gvt=1"
] ++ optional cfg.i915.powersave "i915.enable_fbc=1";
};
}