Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
48 lines
1.0 KiB
Nix
48 lines
1.0 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
options,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.services.prometheus.exporters.apcupsd;
|
|
inherit (lib) mkOption types concatStringsSep;
|
|
in
|
|
{
|
|
port = 9162;
|
|
extraOpts = {
|
|
apcupsdAddress = mkOption {
|
|
type = types.str;
|
|
default = ":3551";
|
|
description = ''
|
|
Address of the apcupsd Network Information Server (NIS).
|
|
'';
|
|
};
|
|
|
|
apcupsdNetwork = mkOption {
|
|
type = types.enum [
|
|
"tcp"
|
|
"tcp4"
|
|
"tcp6"
|
|
];
|
|
default = "tcp";
|
|
description = ''
|
|
Network of the apcupsd Network Information Server (NIS): one of "tcp", "tcp4", or "tcp6".
|
|
'';
|
|
};
|
|
};
|
|
serviceOpts = {
|
|
serviceConfig = {
|
|
ExecStart = ''
|
|
${pkgs.prometheus-apcupsd-exporter}/bin/apcupsd_exporter \
|
|
-telemetry.addr ${cfg.listenAddress}:${toString cfg.port} \
|
|
-apcupsd.addr ${cfg.apcupsdAddress} \
|
|
-apcupsd.network ${cfg.apcupsdNetwork} \
|
|
${concatStringsSep " \\\n " cfg.extraFlags}
|
|
'';
|
|
};
|
|
};
|
|
}
|