diff --git a/modules/nixos/services/influxdb2.nix b/modules/nixos/services/influxdb2.nix index d720026..adef3e0 100644 --- a/modules/nixos/services/influxdb2.nix +++ b/modules/nixos/services/influxdb2.nix @@ -5,7 +5,7 @@ { config, lib, ... }: { - config = { + config = lib.mkIf config.services.influxdb2.enable { services.influxdb2 = { provision = { diff --git a/modules/nixos/services/prometheus.nix b/modules/nixos/services/prometheus.nix index d1239c4..fdb505d 100644 --- a/modules/nixos/services/prometheus.nix +++ b/modules/nixos/services/prometheus.nix @@ -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 + [ ]; }; diff --git a/modules/nixos/services/victoriametrics.nix b/modules/nixos/services/victoriametrics.nix index 191c889..70f9524 100644 --- a/modules/nixos/services/victoriametrics.nix +++ b/modules/nixos/services/victoriametrics.nix @@ -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