nixos/prometheus-kea-exporter: init

This commit is contained in:
Martin Weinelt 2021-05-12 21:49:22 +02:00
parent 7944ea7b66
commit bc4a80979b
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
2 changed files with 39 additions and 0 deletions

View file

@ -34,6 +34,7 @@ let
"fritzbox"
"json"
"jitsi"
"kea"
"keylight"
"knot"
"lnd"

View file

@ -0,0 +1,38 @@
{ config
, lib
, pkgs
, options
}:
with lib;
let
cfg = config.services.prometheus.exporters.kea;
in {
port = 9547;
extraOpts = {
controlSocketPaths = mkOption {
type = types.listOf types.str;
example = literalExample ''
[
"/run/kea/kea-dhcp4.socket"
"/run/kea/kea-dhcp6.socket"
]
'';
description = ''
Paths to kea control sockets
'';
};
};
serviceOpts = {
serviceConfig = {
ExecStart = ''
${pkgs.prometheus-kea-exporter}/bin/kea-exporter \
--address ${cfg.listenAddress} \
--port ${toString cfg.port} \
${concatStringsSep " \\n" cfg.controlSocketPaths}
'';
SupplementaryGroups = [ "kea" ];
};
};
}