{ config, lib, ... }: with lib; let rootCfg = config.selfhosted; common = rootCfg.common; moduleCfg = rootCfg.monitoring; in { config = mkIf moduleCfg.enable { sops.templates."prometheus.yml".restartUnits = [ "${common.backend}-${moduleCfg.prometheus.name}.service" ]; sops.templates."prometheus.yml".content = '' global: scrape_interval: 15s evaluation_interval: 15s scrape_configs: - job_name: prometheus static_configs: - targets: - localhost:9090 - job_name: node static_configs: - targets: - ${moduleCfg.nodeExporter.name}:9100 ''; }; }