From 22da52f7a79e529ccfa8934a07c4708f2edd46d9 Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Sun, 29 Sep 2024 00:45:48 +0300 Subject: [PATCH] feat: Laptop battery optimisations --- nixos/hosts/Senko/configuration.nix | 1 + nixos/modules/laptop.nix | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 nixos/modules/laptop.nix diff --git a/nixos/hosts/Senko/configuration.nix b/nixos/hosts/Senko/configuration.nix index 20d9dc6..652051b 100644 --- a/nixos/hosts/Senko/configuration.nix +++ b/nixos/hosts/Senko/configuration.nix @@ -5,6 +5,7 @@ ../../modules/bundle.nix ../../modules/gamemode.nix ../../modules/users/sweetbread.nix + ../../modules/laptop.nix ]; networking.hostName = "Senko"; diff --git a/nixos/modules/laptop.nix b/nixos/modules/laptop.nix new file mode 100644 index 0000000..d48f634 --- /dev/null +++ b/nixos/modules/laptop.nix @@ -0,0 +1,17 @@ +{ + services.tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 25; + }; + }; +}