Files
nix-config/hosts/common/optional/thermal-management.nix
2025-08-19 09:23:21 -03:00

83 lines
3.1 KiB
Nix

{
services.thermald.enable = false;
services.tlp = {
enable = true;
settings =
# In services.tlp.settings
{
# --- CPU Settings for Core Ultra 9 185H ---
# Use the modern 'intel_pstate' driver in active mode. This is correct.
CPU_DRIVER_OPMODE_ON_AC = "active";
CPU_DRIVER_OPMODE_ON_BAT = "active";
# CRITICAL: Use 'powersave' for both. On modern Intel chips, this enables
# dynamic scaling from idle up to max boost. It is the best-performing
# and most efficient setting.
CPU_SCALING_GOVERNOR_ON_AC = "powersave";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
# This is your main performance tuning knob. 'performance' tells the CPU
# to aggressively ramp up to high clock speeds when it detects a load.
# 'balance_power' is a good choice for extending battery life.
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power";
# Allow the CPU to use its full performance range when plugged in.
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 60; # Slightly higher than before for better battery responsiveness.
# ESSENTIAL: Enable Turbo Boost on AC. This is how you get peak performance.
# The 'powersave' governor will use boost intelligently when needed.
# Disabling on battery is key for thermal control and battery life.
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
# HWP Dynamic Boost is a good feature to keep enabled.
CPU_HWP_DYN_BOOST_ON_AC = 1;
CPU_HWP_DYN_BOOST_ON_BAT = 1;
# --- Intel Arc GPU & System Settings ---
# Set the platform profile. 'balanced' is a much safer bet than 'performance'
# to avoid overwhelming the chassis's cooling solution.
PLATFORM_PROFILE_ON_AC = "balanced";
PLATFORM_PROFILE_ON_BAT = "low-power";
# Use 'powersupersave' for PCIe ASPM. This allows the components,
# including the GPU, to enter deeper sleep states, reducing idle heat.
PCIE_ASPM_ON_AC = "powersupersave";
PCIE_ASPM_ON_BAT = "powersupersave";
# Runtime Power Management is crucial for the integrated GPU to power down
# when not in heavy use. 'auto' is the recommended setting for modern hardware.
RUNTIME_PM_ON_AC = "auto";
RUNTIME_PM_ON_BAT = "auto";
# Whitelist everything except devices known to cause issues (like some audio codecs).
# The default blacklist is usually sufficient.
RUNTIME_PM_DRIVER_BLACKLIST = "amdgpu nouveau nvidia pcieport";
# --- Other Power Saving ---
# Keep Wi-Fi power saving on; it's generally fine.
WIFI_PWR_ON_AC = "on";
WIFI_PWR_ON_BAT = "on";
# Sound power saving is fine.
SOUND_POWER_SAVE_ON_AC = 1;
SOUND_POWER_SAVE_ON_BAT = 1;
SOUND_POWER_SAVE_CONTROLLER = "Y";
# USB autosuspend is fine.
USB_AUTOSUSPEND = 1;
};
};
#powerManagement.powertop.enable = true;
services.power-profiles-daemon.enable = false;
}