2025-04-09 15:31:18 +02:00
|
|
|
{
|
|
|
|
config,
|
2025-05-14 11:22:39 +02:00
|
|
|
inputs,
|
2025-04-09 15:31:18 +02:00
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (lib.modules) mkDefault;
|
|
|
|
in {
|
2025-05-14 11:22:39 +02:00
|
|
|
imports = [
|
|
|
|
inputs.superfreq.nixosModules.default
|
|
|
|
];
|
2025-04-09 15:31:18 +02:00
|
|
|
config = {
|
|
|
|
environment.systemPackages = builtins.attrValues {
|
|
|
|
inherit
|
|
|
|
(pkgs)
|
|
|
|
acpi
|
|
|
|
powertop
|
|
|
|
;
|
|
|
|
};
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
kernelModules = ["acpi_call"];
|
|
|
|
extraModulePackages = with config.boot.kernelPackages; [
|
|
|
|
acpi_call
|
|
|
|
cpupower
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware.acpilight.enable = false;
|
|
|
|
|
2025-05-17 23:47:19 +02:00
|
|
|
services.superfreq = {
|
|
|
|
enable = true;
|
|
|
|
# sample config from https://github.com/NotAShelf/superfreq#sample-configuration
|
|
|
|
settings = {
|
|
|
|
charger = {
|
|
|
|
# CPU governor to use
|
|
|
|
governor = "performance";
|
|
|
|
# Turbo boost setting: "always", "auto", or "never"
|
|
|
|
turbo = "auto";
|
|
|
|
# Energy Performance Preference
|
|
|
|
epp = "performance";
|
|
|
|
# Energy Performance Bias (0-15 scale or named value)
|
|
|
|
epb = "balance_performance";
|
|
|
|
# Platform profile (if supported)
|
|
|
|
platform_profile = "performance";
|
|
|
|
# Min/max frequency in MHz (optional)
|
|
|
|
min_freq_mhz = 800;
|
|
|
|
max_freq_mhz = 3500;
|
|
|
|
# Optional: Profile-specific battery charge thresholds (overrides global setting)
|
|
|
|
# battery_charge_thresholds = [40, 80] # Start at 40%, stop at 80%
|
|
|
|
};
|
|
|
|
|
|
|
|
battery = {
|
|
|
|
governor = "powersave";
|
|
|
|
turbo = "auto";
|
|
|
|
epp = "power";
|
|
|
|
epb = "balance_power";
|
|
|
|
platform_profile = "low-power";
|
|
|
|
min_freq_mhz = 800;
|
|
|
|
max_freq_mhz = 2500;
|
|
|
|
};
|
|
|
|
|
|
|
|
daemon = {
|
|
|
|
# Base polling interval in seconds
|
|
|
|
poll_interval_sec = 5;
|
|
|
|
# Enable adaptive polling that changes with system state
|
|
|
|
adaptive_interval = true;
|
|
|
|
# Minimum polling interval for adaptive polling (seconds)
|
|
|
|
min_poll_interval_sec = 1;
|
|
|
|
# Maximum polling interval for adaptive polling (seconds)
|
|
|
|
max_poll_interval_sec = 30;
|
|
|
|
# Double the polling interval when on battery to save power
|
|
|
|
throttle_on_battery = true;
|
|
|
|
# Logging level: Error, Warning, Info, Debug
|
|
|
|
log_level = "Info";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2025-04-09 15:31:18 +02:00
|
|
|
services = {
|
|
|
|
upower = {
|
|
|
|
enable = true;
|
|
|
|
percentageLow = 15;
|
|
|
|
percentageCritical = 5;
|
|
|
|
};
|
|
|
|
|
|
|
|
acpid = {
|
|
|
|
enable = true;
|
|
|
|
logEvents = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
auto-cpufreq = {
|
2025-05-15 11:23:22 +02:00
|
|
|
enable = false;
|
2025-04-09 15:31:18 +02:00
|
|
|
settings = {
|
|
|
|
charger = {
|
|
|
|
governor = "performance";
|
|
|
|
energy_performance_preference = "performance";
|
|
|
|
scaling_min_freq = mkDefault 1800000;
|
|
|
|
scaling_max_freq = mkDefault 3800000;
|
|
|
|
turbo = "auto";
|
|
|
|
};
|
|
|
|
|
|
|
|
battery = {
|
|
|
|
governor = "powersave";
|
|
|
|
energy_performance_preference = "power";
|
|
|
|
scaling_min_freq = mkDefault 1200000;
|
|
|
|
scaling_max_freq = mkDefault 1800000;
|
|
|
|
turbo = "never";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|