better wireguard check predicate for monitoring config

This commit is contained in:
oxapentane - 2023-05-05 20:59:58 +02:00
parent b6c3fe8762
commit 42c3630162
Signed by: oxapentane
GPG Key ID: 91FA5E5BF9AA901C
1 changed files with 2 additions and 5 deletions

View File

@ -24,12 +24,9 @@ in
config =
let
wg-addr-pred = !isNull config.deployment-TLMS.net.wg.addr4;
check-wg = enabled:
lib.assertMsg (enabled && wg-addr-pred)
''For monitoring to be working the system must be in wireguard. See config.deplayment-TLMS.net.wg'';
wg-addr-pred = lib.assertMsg (!(isNull config.deployment-TLMS.net.wg.addr4)) "to add system to monitoring, add it to TLMS wireguard first!";
in
lib.mkIf (check-wg cfg.enable) {
lib.mkIf (cfg.enable && wg-addr-pred) {
# prometheus node exporter
services.prometheus.exporters = {
node = {