2024-07-05 11:25:27 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (lib) mkOption types;
|
|
|
|
in
|
|
|
|
{
|
2024-07-05 12:18:23 +00:00
|
|
|
imports = [
|
|
|
|
./baseline.nix
|
|
|
|
./nginx.nix
|
2024-07-05 12:51:26 +00:00
|
|
|
./postgres.nix
|
2024-07-05 12:18:23 +00:00
|
|
|
];
|
2024-07-05 11:25:27 +00:00
|
|
|
|
|
|
|
options.bagel = {
|
|
|
|
meta.monitoring = {
|
|
|
|
address = mkOption {
|
|
|
|
description = "Node's public address";
|
|
|
|
type = types.str;
|
|
|
|
};
|
|
|
|
exporters = mkOption {
|
|
|
|
description = "List of all exporters to scrape";
|
|
|
|
type = types.listOf (types.submodule {
|
|
|
|
options.port = mkOption {
|
|
|
|
description = "Exporter port";
|
|
|
|
type = types.int;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
default = [];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config.networking.firewall.allowedTCPPorts = map (e: e.port) config.bagel.meta.monitoring.exporters;
|
|
|
|
}
|