24 lines
No EOL
477 B
Nix
24 lines
No EOL
477 B
Nix
{lib, ...}:
|
|
let
|
|
serv = import ../config/services.nix;
|
|
conf = lib.attrsets.mapAttrsToList (name: cfg: {
|
|
job_name = name;
|
|
|
|
scrape_interval = cfg.scrape_interval;
|
|
|
|
metrics_path = cfg.metrics_path;
|
|
|
|
static_configs = cfg.static_configs;
|
|
}) serv.prometheus.scrapeConfigs;
|
|
in
|
|
{
|
|
services.prometheus = {
|
|
enable = true;
|
|
|
|
scrapeConfigs = conf;
|
|
|
|
port = serv.prometheus.port;
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = [ serv.prometheus.port ];
|
|
} |