nix: tucked away hosts

This commit is contained in:
Primrose 2024-07-12 23:34:50 +02:00
parent f573e1a1a9
commit 32eafdd5fe
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
16 changed files with 2 additions and 3 deletions

View file

@ -0,0 +1,19 @@
{ pkgs, ... }:
{
systemd.services.battery-charge-threshold = {
enable = true;
description = "Set the battery charge threshold";
unitConfig = {
After = "multi-user.target";
StartLimitBurst = 0;
};
serviceConfig = {
User = "root";
Group = "root";
Type = "oneshot";
Restart = "on-failure";
ExecStart = "${pkgs.bash}/bin/bash -c 'echo 70 > /sys/class/power_supply/BAT1/charge_control_start_threshold; echo 80 > /sys/class/power_supply/BAT1/charge_control_end_threshold'";
};
wantedBy = [ "multi-user.target" ];
};
}