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

@ -46,15 +46,6 @@
# security # security
security.useDoas = true; security.useDoas = true;
}; };
hardware = {
audio.enable = true;
bluetooth.enable = true;
print.enable = true;
pointer.enable = true;
tablet.enable = true;
networking.enable = true;
rgb.enable = true;
};
desktop = { desktop = {
# set to `x11` or `wayland`, improves compat # set to `x11` or `wayland`, improves compat
envProto = "wayland"; envProto = "wayland";

View file

@ -21,10 +21,17 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
# radv > amdvlk modules.hardware = {
environment.variables.AMD_VULKAN_ICD = "RADV"; graphics.amdgpu.enable = true;
graphics.amdgpu.overclock = true;
environment.systemPackages = with pkgs; [ amdgpu_top ]; audio.enable = true;
bluetooth.enable = true;
networking.enable = true;
print.enable = true;
pointer.enable = true;
rgb.enable = true;
tablet.enable = true;
};
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/5da6bab0-856a-4e65-8ff6-5b70fe3764b8"; { device = "/dev/disk/by-uuid/5da6bab0-856a-4e65-8ff6-5b70fe3764b8";

View file

@ -19,9 +19,6 @@
always_full_speed = false; always_full_speed = false;
}; };
# better performance than the actual intel driver
services.xserver.videoDrivers = [ "modesetting" ];
# replace basic t2 kernel with cachyos kernel # replace basic t2 kernel with cachyos kernel
# same patches and i trust it to be more up to date (one time the "latest" was EOL for t2,,,) # same patches and i trust it to be more up to date (one time the "latest" was EOL for t2,,,)
# also interesting how this supports l4 but my big computer doesn't... # also interesting how this supports l4 but my big computer doesn't...
@ -30,18 +27,10 @@
# fix wifi firmware # fix wifi firmware
hardware.apple-t2.firmware.enable = true; hardware.apple-t2.firmware.enable = true;
environment.variables = { hardware.intelgpu.driver = "i915";
LIBVA_DRIVER_NAME= "iHD"; # support gen8-11 (i915) rather than gen12+ (xe)
VDPAU_DRIVER = "va_gl"; hardware.intelgpu.computeRuntime = "legacy";
}; hardware.intelgpu.mediaRuntime = "intel-media-sdk";
environment.systemPackages = with pkgs; [ intel-gpu-tools ];
boot.kernelParams = [
# enable the i915 sandybridge framebuffer compression (475mw savings)
"i915.enable_fbc=1"
"i915.enable_gvt=1"
];
# fix sleep/suspend # fix sleep/suspend
# ty https://github.com/3ulalia/flake/blob/aaddbef19979c6d952f7a763cd9e6225d6330a02/hosts/catalina/default.nix # ty https://github.com/3ulalia/flake/blob/aaddbef19979c6d952f7a763cd9e6225d6330a02/hosts/catalina/default.nix

View file

@ -38,13 +38,6 @@
# security # security
security.useDoas = true; security.useDoas = true;
}; };
hardware = {
audio.enable = true;
bluetooth.enable = true;
print.enable = true;
pointer.enable = true;
networking.enable = true;
};
desktop = { desktop = {
# set to `x11` or `wayland`, improves compat # set to `x11` or `wayland`, improves compat
envProto = "wayland"; envProto = "wayland";

View file

@ -4,7 +4,8 @@
imports = imports =
[ [
inputs.hardware.nixosModules.apple-t2 inputs.hardware.nixosModules.apple-t2
inputs.hardware.nixosModules.common-cpu-intel (inputs.hardware + "/common/cpu/intel/ice-lake")
(inputs.hardware + "/common/gpu/intel/ice-lake")
inputs.hardware.nixosModules.common-pc-laptop-ssd inputs.hardware.nixosModules.common-pc-laptop-ssd
inputs.hardware.nixosModules.common-pc-laptop inputs.hardware.nixosModules.common-pc-laptop
@ -21,6 +22,14 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
modules.hardware = {
graphics.i915.enable = true;
audio.enable = true;
bluetooth.enable = true;
networking.enable = true;
pointer.enable = true;
};
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/0f09afdc-88e4-4764-818b-77828931278f"; { device = "/dev/disk/by-uuid/0f09afdc-88e4-4764-818b-77828931278f";
fsType = "ext4"; fsType = "ext4";

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";
};
}