nixos/prometheus-wireguard-exporter: add support for `-r` switch
With this switch activated, the exporter also exposes the remote IP of each active WireGuard peer.
This commit is contained in:
parent
e80b0b2b22
commit
41b9c5f1da
|
@ -34,6 +34,14 @@ in {
|
|||
<literal>allowed_ip_1</literal> and so on.
|
||||
'';
|
||||
};
|
||||
|
||||
withRemoteIp = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether or not the remote IP of a WireGuard peer should be exposed via prometheus.
|
||||
'';
|
||||
};
|
||||
};
|
||||
serviceOpts = {
|
||||
path = [ pkgs.wireguard-tools ];
|
||||
|
@ -45,6 +53,7 @@ in {
|
|||
-p ${toString cfg.port} \
|
||||
${optionalString cfg.verbose "-v"} \
|
||||
${optionalString cfg.singleSubnetPerField "-s"} \
|
||||
${optionalString cfg.withRemoteIp "-r"} \
|
||||
${optionalString (cfg.wireguardConfig != null) "-n ${cfg.wireguardConfig}"}
|
||||
'';
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue