0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 14:10:33 +03:00

nixos/prometheus-wireguard-exporter: Add a new option to export wireguard_latest_handshake_delay_seconds. (#419815)

This commit is contained in:
Franz Pletz 2025-06-30 12:25:18 +02:00 committed by GitHub
commit e8c0884917
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,6 +62,14 @@ in
Whether or not the remote IP of a WireGuard peer should be exposed via prometheus.
'';
};
latestHandshakeDelay = mkOption {
type = types.bool;
default = false;
description = ''
Adds the `wireguard_latest_handshake_delay_seconds` metric that automatically calculates the seconds passed since the last handshake.
'';
};
};
serviceOpts = {
path = [ pkgs.wireguard-tools ];
@ -76,6 +84,7 @@ in
${optionalString cfg.verbose "-v true"} \
${optionalString cfg.singleSubnetPerField "-s true"} \
${optionalString cfg.withRemoteIp "-r true"} \
${optionalString cfg.latestHandshakeDelay "-d true"} \
${optionalString (cfg.wireguardConfig != null) "-n ${escapeShellArg cfg.wireguardConfig}"}
'';
RestrictAddressFamilies = [