mirror of
https://github.com/ItsDrike/nixdots
synced 2025-06-30 16:30:42 +00:00
Rework laptop battery/power optimization settings
This commit is contained in:
parent
dd00ed5f70
commit
a0bba2e225
4 changed files with 133 additions and 37 deletions
|
@ -3,6 +3,10 @@
|
|||
deviceType = config.myOptions.device.roles.type;
|
||||
acceptedTypes = ["laptop"];
|
||||
in {
|
||||
imports = [
|
||||
./auto-cpufreq
|
||||
];
|
||||
|
||||
config = mkIf (builtins.elem deviceType acceptedTypes) {
|
||||
hardware.acpilight.enable = true;
|
||||
|
||||
|
@ -15,48 +19,11 @@ in {
|
|||
# handle ACPI events
|
||||
acpid.enable = true;
|
||||
|
||||
# allows changing system behavior based upon user-selected power profiles
|
||||
power-profiles-daemon.enable = true;
|
||||
|
||||
# temperature target on battery
|
||||
undervolt = {
|
||||
tempBat = 65; # deg C
|
||||
package = pkgs.undervolt;
|
||||
};
|
||||
|
||||
# superior power management
|
||||
auto-cpufreq = {
|
||||
enable = true;
|
||||
|
||||
# define the profiles
|
||||
# (you can manually switch between profiles using `powerprofilesctl` cmd)
|
||||
settings = let
|
||||
MHz = x: x * 1000;
|
||||
in {
|
||||
battery = {
|
||||
governor = "powersave";
|
||||
scaling_min_freq = mkDefault (MHz 1200);
|
||||
scaling_max_freq = mkDefault (MHz 1800);
|
||||
turbo = "never";
|
||||
};
|
||||
|
||||
charger = {
|
||||
governor = "performance";
|
||||
scaling_min_freq = mkDefault (MHz 1800);
|
||||
scaling_max_freq = mkDefault (MHz 3800);
|
||||
turbo = "auto";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# DBus service that provides power management support to applications
|
||||
upower = {
|
||||
enable = true;
|
||||
percentageLow = 15;
|
||||
percentageCritical = 5;
|
||||
percentageAction = 3;
|
||||
criticalPowerAction = "Hibernate";
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue