From 3beb45a08b058c1e0e8e473af656684765fe495a Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Wed, 5 Aug 2020 18:45:44 +0400 Subject: [PATCH] update power settings --- modules/power.nix | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/modules/power.nix b/modules/power.nix index f2445ce..9279e03 100644 --- a/modules/power.nix +++ b/modules/power.nix @@ -6,6 +6,24 @@ with rec { with deviceSpecific; { services.tlp = { enable = isLaptop; + # New settings format in master branch nixpkgs + # settings = { + # CPU_SCALING_GOVERNOR_ON_AC = "powersave"; + # CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + # CPU_HWP_ON_AC = "balance_performance"; + # CPU_HWP_ON_BAT = "balance_power"; + # CPU_BOOST_ON_AC = 1; + # CPU_BOOST_ON_BAT = 0; + # SCHED_POWERSAVE_ON_AC = 0; + # SCHED_POWERSAVE_ON_BAT = 1; + # CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance"; + # CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power"; + # DISK_DEVICES = "\"nvme0n1 sda\""; + # DISK_APM_LEVEL_ON_AC = "\"255 254\""; + # DISK_APM_LEVEL_ON_BAT = "\"255 254\""; + # SATA_LINKPWR_ON_BAT = "\"med_power_with_dipm max_performance\""; + # SATA_LINKPWR_ON_AC = "\"med_power_with_dipm max_performance\""; + # }; extraConfig = '' # Recommended CPU_SCALING_GOVERNOR_ON_AC=powersave @@ -25,19 +43,9 @@ with deviceSpecific; { SATA_LINKPWR_ON_BAT="med_power_with_dipm max_performance" SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance" ''; - # TLP >1.3 - # tlp1_3 = '' - # # instead CPU_ENERGY_PERF_POLICY_ON_* - # CPU_ENERGY_PERF_POLICY_ON_AC=balance_performance - # CPU_ENERGY_PERF_POLICY_ON_BAT=balance_power - # ''; }; - # TODO: obsolete? - powerManagement.cpuFreqGovernor = - lib.mkIf config.services.tlp.enable (lib.mkForce null); - services.undervolt = lib.mkIf (device == "Dell-Laptop") { enable = true; coreOffset = "-120";