Laptop: Difference between revisions
imported>AmnesiaAmesia m Added initial text about powertop |
imported>AmnesiaAmesia m Added example for auto-cpufreq and corrected small mistakes |
||
| Line 3: | Line 3: | ||
==== tlp ==== | ==== tlp ==== | ||
A common tool used to save power on laptops is tlp, which | A common tool used to save power on laptops is tlp, which has sensible defaults for most laptops. To enable tlp you simply just write <code>services.tlp.enable = true;</code> in your configraion.nix. However, if you need a specific configuration, you can do as shown in the example here below. | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
| Line 26: | Line 26: | ||
==== auto-cpufreq ==== | ==== auto-cpufreq ==== | ||
Another tool used for power management is auto-cpufreq which aims to replace tlp. When using auto-cpufreq it is therefore recommended to disable tlp as these tools are conflicting each other. However NixOS does allow for using both at the same time and you therefore run them in tandem at your own risk. To enable the service just add <code>services.auto-cpufreq.enable = true;</code> to your configuration.nix | Another tool used for power management is auto-cpufreq which aims to replace tlp. When using auto-cpufreq it is therefore recommended to disable tlp as these tools are conflicting with each other. However, NixOS does allow for using both at the same time, and you therefore run them in tandem at your own risk. To enable the service, just add <code>services.auto-cpufreq.enable = true;</code> to your configuration.nix | ||
Example of how to configure auto-cpufreq: | |||
<syntaxHighlight lang=nix> | |||
services.auto-cpufreq.enable = true; | |||
services.auto-cpufreq.settings = { | |||
battery = { | |||
governor = "powersave"; | |||
turbo = "never"; | |||
}; | |||
charger = { | |||
governor = "performance"; | |||
turbo = "auto"; | |||
}; | |||
}; | |||
</syntaxHighlight> | |||
==== Powertop ==== | ==== Powertop ==== | ||
Powertop is a power analysis tool, but it also has a feature | Powertop is a power analysis tool, but it also has a feature referred to as auto-tune which will enable power saving settings on your device. These power saving settings should be almost the same as those enabled by tlp, although you powertop enables usb autosuspend per default. This can make your input devices such as the keyboard unresponsive for some time when it has been suspended. To enable powetop write <code>powerManagement.powertop.enable = true;</code> and it should be noted that this also enables the auto-tune feature of powertop. | ||
== Troubleshooting == | == Troubleshooting == | ||