1{ config
2, lib
3, pkgs
4, options
5}:
6
7with lib;
8
9let
10 cfg = config.services.prometheus.exporters.kea;
11in {
12 port = 9547;
13 extraOpts = {
14 controlSocketPaths = mkOption {
15 type = types.listOf types.str;
16 example = literalExample ''
17 [
18 "/run/kea/kea-dhcp4.socket"
19 "/run/kea/kea-dhcp6.socket"
20 ]
21 '';
22 description = ''
23 Paths to kea control sockets
24 '';
25 };
26 };
27 serviceOpts = {
28 serviceConfig = {
29 ExecStart = ''
30 ${pkgs.prometheus-kea-exporter}/bin/kea-exporter \
31 --address ${cfg.listenAddress} \
32 --port ${toString cfg.port} \
33 ${concatStringsSep " \\n" cfg.controlSocketPaths}
34 '';
35 SupplementaryGroups = [ "kea" ];
36 };
37 };
38}