forked from the-distro/infra
32 lines
668 B
Nix
32 lines
668 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib) mkOption types;
|
|
in
|
|
{
|
|
imports = [./baseline.nix];
|
|
|
|
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;
|
|
} |