also refactor nixos modules

This commit is contained in:
Chris Kruining 2026-03-30 09:32:15 +02:00
parent 2471562583
commit b37c5c0cbd
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
44 changed files with 10 additions and 2 deletions

View file

@ -1,51 +0,0 @@
{
pkgs,
config,
lib,
...
}: let
inherit (builtins) toString;
inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.services.observability.prometheus;
in {
options.sneeuwvlok.services.observability.prometheus = {
enable = mkEnableOption "enable Prometheus";
};
config = mkIf cfg.enable {
services.prometheus = {
enable = true;
port = 9002;
globalConfig.scrape_interval = "15s";
scrapeConfigs = [
{
job_name = "prometheus";
static_configs = [
{targets = ["localhost:9002"];}
];
}
{
job_name = "node";
static_configs = [
{targets = ["localhost:${toString config.services.prometheus.exporters.node.port}"];}
];
}
];
exporters = {
node = {
enable = true;
port = 9005;
enabledCollectors = ["systemd"];
openFirewall = true;
};
};
};
networking.firewall.allowedTCPPorts = [9002];
};
}