[Power] Fix battery and ac power targets

This commit is contained in:
Antoine Viallon 2023-03-31 21:17:49 +02:00
parent 8ed4a576e2
commit d28784953c
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -145,7 +145,7 @@ in {
serviceConfig = {
RemainAfterExit = true;
};
wantedBy = [ "multi-user.target" "ac-power.target" ];
wantedBy = [ "ac-power.target" ];
description = "Set power limit of Intel CPUs with supported firmware. AC mode.";
partOf = [ "ac-power.target" ];
enable = (cfg.powerLimit.enable || cfg.temperature.enable) && (generalCfg.cpuVendor == "intel");
@ -157,10 +157,13 @@ in {
+ optionalString (! isNull cfg.powerLimit.battery.cpuBoost ) " --power-limit-short ${toString cfg.powerLimit.battery.cpuBoost} 0.1"
+ optionalString (! isNull cfg.temperature.battery.cpu ) " --temp ${toString cfg.temperature.battery.cpu}"
;
unitConfig = {
ConditionACPower = false;
};
serviceConfig = {
RemainAfterExit = true;
};
wantedBy = [ "multi-user.target" "battery-power.target" ];
wantedBy = [ "battery-power.target" ];
description = "Set power limit of Intel CPUs with supported firmware. Battery mode.";
partOf = [ "battery-power.target" ];
enable = (cfg.powerLimit.enable || cfg.temperature.enable) && (generalCfg.cpuVendor == "intel");