mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
Using ./home.nix and ./nixos.nix as entrypoints for hosts. Using hardware profiles. Using new entrypoints (profiles/base/profiles.nix + profiles/base/home.nix). New modules (for DNS handling, for themeing, ...). Split up deploy-tf.nix into several modules. Renamed common profile to base profile.
45 lines
1.4 KiB
Nix
45 lines
1.4 KiB
Nix
{ config, hosts, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
prom_configs =
|
|
(mapAttrs (hostName: host: host.config.services.prometheus.exporters.node)
|
|
(filterAttrs
|
|
(_: host: host.config.services.prometheus.exporters.node.enable)
|
|
hosts));
|
|
nd_configs = (mapAttrs (hostName: host: host.config.services.netdata)
|
|
(filterAttrs (_: host: host.config.services.netdata.enable) hosts));
|
|
in
|
|
{
|
|
services.prometheus = {
|
|
enable = true;
|
|
scrapeConfigs = [
|
|
{
|
|
job_name = "boline";
|
|
static_configs = [{ targets = [ "boline.${config.kw.dns.ygg_prefix}.${config.kw.dns.domain}:8002" ]; }];
|
|
}
|
|
{
|
|
job_name = "samhain-vm";
|
|
metrics_path = "/metrics";
|
|
static_configs = [{ targets = [ "samhain.${config.kw.dns.ygg_prefix}.${config.kw.dns.domain}:10445" ]; }];
|
|
}
|
|
] ++ mapAttrsToList
|
|
(hostName: prom: {
|
|
job_name = "${hostName}-nd";
|
|
metrics_path = "/api/v1/allmetrics";
|
|
honor_labels = true;
|
|
params = { format = [ "prometheus" ]; };
|
|
static_configs = [{ targets = [ "${hostName}.${config.kw.dns.ygg_prefix}.${config.kw.dns.domain}:19999" ]; }];
|
|
})
|
|
nd_configs ++ mapAttrsToList
|
|
(hostName: prom: {
|
|
job_name = hostName;
|
|
static_configs = [{
|
|
targets = [ "${hostName}.${config.kw.dns.ygg_prefix}.${config.kw.dns.domain}:${toString prom.port}" ];
|
|
}];
|
|
})
|
|
prom_configs;
|
|
};
|
|
}
|
|
|