2024-08-02 17:55:48 -04:00
|
|
|
{ config, lib, ... }:
|
2024-02-29 09:53:34 -05:00
|
|
|
let
|
2024-06-24 11:38:28 -04:00
|
|
|
cfg = config.aux.system.services.apcupsd;
|
2024-02-29 09:53:34 -05:00
|
|
|
in
|
|
|
|
{
|
2024-05-07 18:02:59 -04:00
|
|
|
options = {
|
2024-06-24 11:38:28 -04:00
|
|
|
aux.system.services.apcupsd = {
|
2024-08-02 17:55:48 -04:00
|
|
|
enable = lib.mkEnableOption "Enables apcupsd";
|
2024-05-21 09:22:03 -04:00
|
|
|
configText = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "The configuration to pass to apcupsd.";
|
|
|
|
};
|
|
|
|
};
|
2024-05-07 18:02:59 -04:00
|
|
|
};
|
2024-02-29 09:53:34 -05:00
|
|
|
|
2024-08-02 17:55:48 -04:00
|
|
|
config = lib.mkIf cfg.enable {
|
2024-05-07 18:02:59 -04:00
|
|
|
services.apcupsd = {
|
|
|
|
enable = true;
|
2024-05-21 09:22:03 -04:00
|
|
|
configText = cfg.configText;
|
2024-05-07 18:02:59 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|