infra/nix/os/devices/steveej-t14/hw.nix
Stefan Junker 5af42df5a9 steveej-x13s-rmvbl: init with minimal setup
this configures a standalone USB device that doesn't need configuration
of the firmware's EFI variables.
2024-01-22 10:35:45 +01:00

106 lines
2.5 KiB
Nix

{ lib, ... }:
let
in
{
# TASK: new device
hardware.opinionatedDisk = {
enable = true;
encrypted = true;
diskId = "nvme-WD_BLACK_SN850X_4000GB_2227DT443901";
earlyDiskIdOverride = "usb-JMicron_Generic_0123456789ABCDEF-0:0";
};
# boot.loader.grub.device = lib.mkForce "/dev/disk/by-id/usb-JMicron_Generic_0123456789ABCDEF-0:0";
# see https://linrunner.de/tlp/
services.tlp = {
enable = false;
settings = {
CPU_DRIVER_OPMODE_ON_AC = "active";
CPU_DRIVER_OPMODE_ON_BAT = "passive";
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_BOOST_ON_AC = "0";
CPU_BOOST_ON_BAT = "0";
RADEON_DPM_PERF_LEVEL_ON_AC = "low";
RADEON_DPM_PERF_LEVEL_ON_BAT = "low";
RADEON_POWER_PROFILE_ON_AC = "low";
RADEON_POWER_PROFILE_ON_BAT = "low";
RADEON_DPM_STATE_ON_AC = "battery";
RADEON_DPM_STATE_ON_BAT = "battery";
# SOUND_POWER_SAVE_ON_AC="1";
SOUND_POWER_SAVE_ON_BAT = "1";
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
RUNTIME_PM_ON_AC = "on";
RUNTIME_PM_ON_BAT = "auto";
PCIE_ASPM_ON_AC = "default";
PCIE_ASPM_ON_BAT = "powersupersave";
START_CHARGE_THRESH_BAT0 = "80";
STOP_CHARGE_THRESH_BAT0 = "85";
WOL_DISABLE = "Y";
# WIFI_PWR_ON_AC="on";
# WIFI_PWR_ON_BAT = "on";
DEVICES_TO_DISABLE_ON_STARTUP = "wwan";
# #DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan";
# #DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan";
# #DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi";
SATA_LINKPWR_ON_AC = "max_performance";
SATA_LINKPWR_ON_BAT = "min_power";
};
};
# see https://www.kernel.org/doc/html/v6.6/admin-guide/laptops/thinkpad-acpi.html#fan-control-and-monitoring-fan-speed-fan-enable-disable
services.thinkfan = {
enable = false;
levels = [
# ["level auto" 0 60]
[ 0 0 60 ]
[ 1 60 65 ]
[ 1 65 75 ]
[ 2 75 78 ]
[ 3 78 80 ]
[ 4 80 82 ]
[ 5 82 84 ]
[ 6 84 86 ]
[ 7 86 88 ]
[ "level full-speed" 88 999 ]
];
extraArgs = [
"-b-3"
"-s1"
];
};
hardware.enableRedistributableFirmware = true;
boot.initrd.kernelModules = [
"aesni_intel"
"kvm_amd"
"nvme"
"nvme_core"
"thunderbolt"
"e1000e"
"usbcore"
"xhci_hcd"
"usbhid"
"usb_storage"
"xhci_pci"
"uas"
];
}