Laptop: Difference between revisions
Corrected config |
typo |
||
| Line 19: | Line 19: | ||
A common tool used to save power on laptops is [https://linrunner.de/tlp/index.html TLP], which has sensible defaults for most laptops. To enable TLP you simply just write <code>services.tlp.enable = true;</code> in your <code>configuration.nix</code>. However, if you need a specific configuration, you can do as shown in the example below. | A common tool used to save power on laptops is [https://linrunner.de/tlp/index.html TLP], which has sensible defaults for most laptops. To enable TLP you simply just write <code>services.tlp.enable = true;</code> in your <code>configuration.nix</code>. However, if you need a specific configuration, you can do as shown in the example below. | ||
< | <syntaxhighlight lang="nix"> | ||
services.tlp = { | services.tlp = { | ||
enable = true; | enable = true; | ||
| Line 35: | Line 35: | ||
# Optional helps save long term battery health | # Optional helps save long term battery health | ||
START_CHARGE_THRESH_BAT0 = 40; # 40 and | START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge | ||
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging | STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging | ||
}; | }; | ||
}; | }; | ||
</ | </syntaxhighlight> | ||
This example enables TLP and sets the minimum and maximum frequencies for the CPU based on whether it is plugged into power or not. It also changes the CPU scaling governor based on this. | This example enables TLP and sets the minimum and maximum frequencies for the CPU based on whether it is plugged into power or not. It also changes the CPU scaling governor based on this. | ||