aboutsummaryrefslogtreecommitdiff
path: root/hosts/mercury/battery.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/mercury/battery.nix')
-rw-r--r--hosts/mercury/battery.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/hosts/mercury/battery.nix b/hosts/mercury/battery.nix
new file mode 100644
index 0000000..ff7e59e
--- /dev/null
+++ b/hosts/mercury/battery.nix
@@ -0,0 +1,47 @@
+{pkgs, ...}: {
+ # auto-cpufreq
+ services.power-profiles-daemon.enable = false; # conflicts with auto-cpufreq
+ services.tlp.enable = false; # conflicts with auto-cpufreq
+ services.thermald.enable = true; # does not conflict, recomended to run with auto-cpufreq
+ services.auto-cpufreq = {
+ enable = true;
+ settings = {
+ charger = {
+ governor = "performance";
+ energy_performance_preference = "performance";
+ turbo = "auto";
+ };
+ battery = {
+ governor = "powersave";
+ energy_performance_preference = "power";
+ turbo = "never";
+ };
+ };
+ };
+
+ # Undervolt
+ services.undervolt = {
+ enable = true;
+ useTimer = false;
+ # power-limit-long
+ p1 = {
+ window = 1; # no clue what this means
+ limit = 40;
+ };
+
+ # power-limit-short
+ p2 = {
+ window = 1;
+ limit = 50;
+ };
+
+ coreOffset = -50; # also applied to cache
+ gpuOffset = -10;
+ };
+
+ # environment.systemPackages = with pkgs; [
+ # undervolt
+ # s-tui
+ # stress
+ # ];
+}