fix(tuned/laptop): auto profile swap
This commit is contained in:
@@ -65,13 +65,13 @@ let
|
||||
[doloro-power-saver]
|
||||
virt=
|
||||
system=
|
||||
/sys/class/power_supply/AC/online=0
|
||||
/sys/class/power_supply/BAT0/status=Discharging
|
||||
|
||||
# Profile for devices on AC power
|
||||
[doloro-balanced]
|
||||
virt=
|
||||
system=
|
||||
/sys/class/power_supply/AC/online=1
|
||||
/sys/class/power_supply/BAT0/status=Charging
|
||||
|
||||
[atomic-host]
|
||||
virt=
|
||||
@@ -148,42 +148,41 @@ in
|
||||
# };
|
||||
services.tuned = {
|
||||
enable = true;
|
||||
autoProfile = true;
|
||||
extraProfiles = {
|
||||
doloro-power-saving = {
|
||||
description = "Custom power-saving profile inheriting from powersave";
|
||||
config = ''
|
||||
include=powersave
|
||||
|
||||
[plugins]
|
||||
script=on
|
||||
|
||||
[script]
|
||||
script=${battery-limit-script}/bin/set-battery-limit,${gpu-limit-frequency}/bin/set-gpu-limit
|
||||
mode=start
|
||||
'';
|
||||
profiles = {
|
||||
doloro-power-saver = {
|
||||
main = {
|
||||
include = "powersave";
|
||||
};
|
||||
script = {
|
||||
script = "${battery-limit-script}/bin/set-battery-limit,${gpu-limit-frequency}/bin/set-gpu-limit";
|
||||
};
|
||||
};
|
||||
doloro-balanced = {
|
||||
description = "Custom balanced profile inheriting from balanced";
|
||||
config = ''
|
||||
include=balanced
|
||||
|
||||
[plugins]
|
||||
script=on
|
||||
|
||||
[script]
|
||||
script=${battery-limit-script}/bin/set-battery-limit
|
||||
mode=start
|
||||
'';
|
||||
main = {
|
||||
include = "balanced";
|
||||
};
|
||||
script = {
|
||||
script = "${battery-limit-script}/bin/set-battery-limit";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
environment.etc = {
|
||||
tuned.recommend.conf = {
|
||||
"tuned/recommend.conf" = {
|
||||
text = tuned-auto-profile-config;
|
||||
};
|
||||
};
|
||||
systemd.services.tuned-auto-profile = {
|
||||
systemd.services = {
|
||||
# Tells tuned "hey, re-eval system state and change profiles accordingly"
|
||||
send-sighup-to-tuned = {
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.killall}/bin/killall -1 .tuned-wrapped";
|
||||
Restart = "always";
|
||||
RestartSec = "30s";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
tuned-auto-profile = {
|
||||
description = "Enable Auto Profile in TuneD";
|
||||
after = [ "network.target" ]; # Ensure network is up (if needed for TuneD)
|
||||
wantedBy = [ "multi-user.target" ]; # Start in the default target mode
|
||||
@@ -196,6 +195,7 @@ in
|
||||
Environment = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; # Ensure PATH is correct
|
||||
};
|
||||
};
|
||||
};
|
||||
services.thermald.enable = true;
|
||||
services.upower = {
|
||||
enable = true;
|
||||
|
||||
Reference in New Issue
Block a user