forked from DGNum/infrastructure
Tom Hubrecht
ecbad0a638
This adds subdirectories for the different types of systems, for the modules and the machines
43 lines
828 B
Nix
43 lines
828 B
Nix
{ config, lib, ... }:
|
|
let
|
|
inherit (lib)
|
|
mkEnableOption
|
|
mkIf
|
|
mkOption
|
|
|
|
types
|
|
;
|
|
cfg = config.dgn-node-monitoring;
|
|
in
|
|
|
|
{
|
|
options.dgn-node-monitoring = {
|
|
enable = mkEnableOption "DGNum nodes monitoring (needs a valid netbird tunnel)" // {
|
|
default = true;
|
|
};
|
|
port = mkOption {
|
|
type = types.port;
|
|
default = 9002;
|
|
description = lib.mdDoc ''
|
|
Port to listen on.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.prometheus = {
|
|
exporters = {
|
|
node = {
|
|
enable = true;
|
|
enabledCollectors = [
|
|
"processes"
|
|
"systemd"
|
|
];
|
|
inherit (cfg) port;
|
|
listenAddress = "0.0.0.0";
|
|
};
|
|
};
|
|
};
|
|
networking.firewall.interfaces.wt0.allowedTCPPorts = [ cfg.port ];
|
|
};
|
|
}
|