diff options
author | lassulus <git@lassul.us> | 2023-09-04 20:36:51 +0200 |
---|---|---|
committer | lassulus <git@lassul.us> | 2023-09-04 20:36:51 +0200 |
commit | 5e215d87e53f97e73247c0d415a416cade9f9328 (patch) | |
tree | 95ecb9d0ad5f0e75f9517c7efadd53f58c626c53 | |
parent | 245dd8b67ffe133dbff76a59a4f9e7f5401f7aec (diff) |
power-action: use upstream writers
-rw-r--r-- | krebs/3modules/power-action.nix | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/krebs/3modules/power-action.nix b/krebs/3modules/power-action.nix index 71e2b541a..a9ed24d3f 100644 --- a/krebs/3modules/power-action.nix +++ b/krebs/3modules/power-action.nix @@ -60,7 +60,7 @@ let }; }; - startScript = pkgs.writeDash "power-action" '' + startScript = pkgs.writers.writeDash "power-action" '' set -euf power="$(${powerlvl})" @@ -77,11 +77,11 @@ let writeRule = _: plan: "if [ $power -ge ${toString plan.lowerLimit} ] && [ $power -le ${toString plan.upperLimit} ] ${charging_check plan}; then ${plan.action}; fi"; - powerlvl = pkgs.writeDash "powerlvl" '' + powerlvl = pkgs.writers.writeDash "powerlvl" '' cat /sys/class/power_supply/${cfg.battery}/capacity ''; - state = pkgs.writeDash "state" '' + state = pkgs.writers.writeDash "state" '' if [ "$(cat /sys/class/power_supply/${cfg.battery}/status)" = "Discharging" ] then echo "false" else echo "true" |