{ self, config, lib, pkgs, ... }: with self.lib.nginx; { services.prometheus = { enable = true; enableReload = true; retentionTime = "14d"; listenAddress = "10.10.0.1"; webExternalUrl = "https://prometheus.vapor.systems"; exporters = { node = { enable = true; enabledCollectors = [ "systemd" ]; }; zfs = { enable = true; }; postgres = { enable = true; }; nginx = { enable = true; }; }; globalConfig = { scrape_interval = "10s"; }; scrapeConfigs = [ { job_name = "node"; static_configs = [ { targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; } ]; } { job_name = "zfs"; static_configs = [ { targets = [ "localhost:${toString config.services.prometheus.exporters.zfs.port}" ]; } ]; } { job_name = "postgres"; static_configs = [ { targets = [ "localhost:${toString config.services.prometheus.exporters.postgres.port}" ]; } ]; } { job_name = "nginx"; static_configs = [ { targets = [ "localhost:${toString config.services.prometheus.exporters.nginx.port}" ]; } ]; } { job_name = "quassel"; static_configs = [ { targets = [ "localhost:${toString config.services.quassel.settings.metrics.port}" ]; } ]; } ]; }; services.nginx.statusPage = true; security.acme.certs = { "vapor.systems" = { extraDomainNames = [ "*.vapor.systems" ]; }; }; services.nginx = { enable = true; virtualHosts = { "prometheus.vapor.systems" = (proxyDomain "vapor.systems" "http://10.10.0.1:9090/"); }; }; }