Files
omnixy/modules/hardware/default.nix
theArctesian c79119dfe6 Fix all deprecation warnings and rename issues
- Reverted mysql back to mysql (mariadb was incorrect)
- Fixed isoImage.isoName -> image.fileName
- Fixed VSCode extensions/userSettings -> profiles.default.*
- Fixed Kitty theme -> themeFile
- Fixed Mako options -> settings structure
- Fixed GPG agent pinentryPackage -> pinentry.package
- Fixed hardware.pulseaudio -> services.pulseaudio
- Fixed hardware.opengl -> hardware.graphics
- Fixed nixos user password conflicts with mkForce
2025-09-29 19:02:15 -07:00

171 lines
3.4 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
{
imports = [
./nvidia.nix
./amd.nix
./intel.nix
./audio.nix
./bluetooth.nix
./touchpad.nix
];
# Common hardware support
hardware = {
# Enable redistributable firmware only
enableRedistributableFirmware = true;
# CPU microcode updates
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# Graphics support
graphics = {
enable = true;
# Common graphics packages
extraPackages = with pkgs; [
intel-media-driver # Intel VAAPI
vaapiIntel
vaapiVdpau
libvdpau-va-gl
intel-compute-runtime # Intel OpenCL
];
extraPackages32 = with pkgs.pkgsi686Linux; [
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
};
# USB support
usb-modeswitch.enable = true;
# Sensor support (for laptops)
sensor.iio.enable = true;
# Scanner support
sane = {
enable = true;
extraBackends = with pkgs; [
sane-airscan
epkowa
];
};
# Firmware updater (moved to services section)
};
# Kernel modules
boot.kernelModules = [
# Virtualization
"kvm-intel"
"kvm-amd"
# USB
"usbhid"
# Network
"iwlwifi"
];
# Power management
powerManagement = {
enable = true;
cpuFreqGovernor = lib.mkDefault "powersave";
};
services = {
# Thermal management
thermald.enable = mkDefault true;
# Power profiles daemon (modern power management)
power-profiles-daemon.enable = true;
# Hardware monitoring
smartd = {
enable = true;
autodetect = true;
};
# Automatic CPU frequency scaling
auto-cpufreq = {
enable = false; # Disabled by default, conflicts with power-profiles-daemon
settings = {
battery = {
governor = "powersave";
turbo = "never";
};
charger = {
governor = "performance";
turbo = "auto";
};
};
};
};
# Additional hardware-specific packages
environment.systemPackages = with pkgs; [
# Hardware info
lshw
hwinfo
inxi
dmidecode
util-linux # provides lscpu
pciutils # provides lspci
usbutils # provides lsusb
# Disk tools
smartmontools
hdparm
nvme-cli
# CPU tools
cpufrequtils
cpupower-gui
# GPU tools
glxinfo
vulkan-tools
# Sensors
lm_sensors
# Power management
powertop
acpi
# Benchmarking
stress
stress-ng
s-tui
];
# Udev rules for hardware
services.udev = {
enable = true;
extraRules = ''
# Allow users in wheel group to control backlight
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="*", GROUP="wheel", MODE="0664"
# Allow users in wheel group to control LEDs
ACTION=="add", SUBSYSTEM=="leds", KERNEL=="*", GROUP="wheel", MODE="0664"
# Gaming controllers
SUBSYSTEM=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="028e", GROUP="wheel", MODE="0664"
SUBSYSTEM=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="028f", GROUP="wheel", MODE="0664"
'';
};
# Virtual console configuration
console = {
earlySetup = true;
font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz";
packages = [ pkgs.terminus_font ];
};
}