This repository has been archived on 2024-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
nixos/hosts/hermes/asus.nix
Payas Relekar 97fc6fc0de hermes: Refactor and split config to separate modules
- asus : charge control
- audio : pipewire
- hardware : boot, encryption etc
2023-08-22 12:34:48 +05:30

23 lines
609 B
Nix

{ pkgs, ... }:
{
services.asusd = {
enable = true;
asusdConfig =
''
"bat_charge_limit": 80,
'';
};
systemd.services.battery-charge-threshold = {
wantedBy = [ "local-fs.target" "suspend.target" ];
after = [ "local-fs.target" "suspend.target" ];
description = "Set the battery charge threshold to 80%";
startLimitBurst = 5;
startLimitIntervalSec = 1;
serviceConfig = {
Type = "oneshot";
Restart = "on-failure";
ExecStart = "${pkgs.runtimeShell} -c 'echo 80 > /sys/class/power_supply/BAT?/charge_control_end_threshold'";
};
};
}