reorganize hardware
This commit is contained in:
parent
0d9381864c
commit
30baa4ce8b
8 changed files with 67 additions and 55 deletions
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
22
modules/hardware/graphics/amdgpu.nix
Normal file
22
modules/hardware/graphics/amdgpu.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ 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 ];
|
||||
|
||||
# radv > amdvlk
|
||||
environment.variables.AMD_VULKAN_ICD = "RADV";
|
||||
};
|
||||
}
|
||||
24
modules/hardware/graphics/i915.nix
Normal file
24
modules/hardware/graphics/i915.nix
Normal 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.powersave "i915.enable_fbc=1";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue