don't enable dyndns for services not running

This commit is contained in:
Noah Masur 2024-03-30 14:48:56 -04:00
parent 1462214a8e
commit 566a654f5b
No known key found for this signature in database
3 changed files with 13 additions and 2 deletions

View File

@ -5,7 +5,7 @@
{ config, lib, ... }: {
config = {
config = lib.mkIf config.services.influxdb2.enable {
services.influxdb2 = {
provision = {

View File

@ -108,7 +108,11 @@
}];
# Configure Cloudflare DNS to point to this machine
services.cloudflare-dyndns.domains = [ config.hostnames.prometheus ];
services.cloudflare-dyndns.domains =
if (config.services.prometheus.enable && isServer) then
[ config.hostnames.prometheus ]
else
[ ];
};

View File

@ -69,6 +69,13 @@ in {
}];
}];
# Configure Cloudflare DNS to point to this machine
services.cloudflare-dyndns.domains =
if config.services.victoriametrics.enable then
[ config.hostnames.prometheus ]
else
[ ];
# VMAgent
services.vmagent.prometheusConfig = prometheusConfig; # Overwritten below