Some checks failed
Run nix flake check / flake-check (push) Has been cancelled
Refactor flake.nix to use a commonModules list for modules shared by all hosts (overlays, sops-nix, nixos-exporter). This simplifies adding new modules that apply to all hosts. Move nixos-exporter configuration to system/monitoring/metrics.nix alongside node-exporter and systemd-exporter. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
39 lines
772 B
Nix
39 lines
772 B
Nix
{ pkgs, ... }:
|
|
{
|
|
services.prometheus.exporters.node = {
|
|
enable = true;
|
|
enabledCollectors = [
|
|
"systemd"
|
|
"logind"
|
|
"cgroups"
|
|
"processes"
|
|
];
|
|
};
|
|
|
|
services.prometheus.exporters.systemd = {
|
|
enable = true;
|
|
# Default port: 9558
|
|
extraFlags = [
|
|
"--systemd.collector.enable-restart-count"
|
|
"--systemd.collector.enable-ip-accounting"
|
|
];
|
|
};
|
|
|
|
services.prometheus.exporters.nixos = {
|
|
enable = true;
|
|
# Default port: 9971
|
|
flake = {
|
|
enable = true;
|
|
url = "git+https://git.t-juice.club/torjus/nixos-servers.git";
|
|
};
|
|
};
|
|
|
|
# Register nixos-exporter as a Prometheus scrape target
|
|
homelab.monitoring.scrapeTargets = [
|
|
{
|
|
job_name = "nixos-exporter";
|
|
port = 9971;
|
|
}
|
|
];
|
|
}
|