aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2024-09-26 16:51:22 +0300
committerZhongheng Liu <z.liu@outlook.com.gr>2024-09-26 16:51:22 +0300
commit0608d646c56a68308d3df1c0a1d19d541938d590 (patch)
tree9bcf331b3655f7d61e7643d096e29bfa91deb61d
parenta479e4633c83862daf4e901186dc9f4d413e133e (diff)
downloadnixos-configuration-0608d646c56a68308d3df1c0a1d19d541938d590.tar.gz
nixos-configuration-0608d646c56a68308d3df1c0a1d19d541938d590.tar.bz2
nixos-configuration-0608d646c56a68308d3df1c0a1d19d541938d590.zip
feat: add extra power-saving profile
-rw-r--r--nixos/services/misc.service.nix6
-rw-r--r--nixos/services/power_management.service.nix22
2 files changed, 25 insertions, 3 deletions
diff --git a/nixos/services/misc.service.nix b/nixos/services/misc.service.nix
index 6a10eb0..72fcd2c 100644
--- a/nixos/services/misc.service.nix
+++ b/nixos/services/misc.service.nix
@@ -1,7 +1,7 @@
{...}: {
- #specialisation.powersave.configuration = {
- # services.auto-cpufreq.enable = true;
- #};
+ specialisation.powersave.configuration = {
+ services.auto-cpufreq.enable = true;
+ };
services = {
upower.enable = true;
udisks2.enable = true;
diff --git a/nixos/services/power_management.service.nix b/nixos/services/power_management.service.nix
new file mode 100644
index 0000000..06d638b
--- /dev/null
+++ b/nixos/services/power_management.service.nix
@@ -0,0 +1,22 @@
+{
+ pkgs,
+ config,
+ lib,
+ ...
+}: {
+ 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 = 20;
+ };
+ };
+}