assertions
This commit is contained in:
@@ -21,6 +21,17 @@ in
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.battery != "";
|
||||
message = "mjallen.hardware.battery.battery must be set to the sysfs path of the battery charge limit file (e.g. \"/sys/class/power_supply/BAT0/charge_control_end_threshold\").";
|
||||
}
|
||||
{
|
||||
assertion = cfg.chargeLimit > 0 && cfg.chargeLimit <= 100;
|
||||
message = "mjallen.hardware.battery.chargeLimit must be between 1 and 100 (got ${toString cfg.chargeLimit}).";
|
||||
}
|
||||
];
|
||||
|
||||
systemd = {
|
||||
services = {
|
||||
set-charge-limit = {
|
||||
|
||||
Reference in New Issue
Block a user