mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git
synced 2024-11-27 21:31:28 +00:00
33 lines
730 B
Nix
33 lines
730 B
Nix
{config, lib, ...}: let
|
|
cfg = config.selfprivacy.modules.monitoring;
|
|
in {
|
|
options.selfprivacy.modules.monitoring = {
|
|
enable = lib.mkOption {
|
|
default = false;
|
|
type = lib.types.bool;
|
|
};
|
|
};
|
|
config = lib.mkIf cfg.enable {
|
|
services.prometheus = {
|
|
enable = true;
|
|
port = 9001;
|
|
listenAddress = "127.0.0.1";
|
|
exporters = {
|
|
node = {
|
|
enable = true;
|
|
enabledCollectors = [ "systemd" ];
|
|
port = 9002;
|
|
listenAddress = "127.0.0.1";
|
|
};
|
|
};
|
|
scrapeConfigs = [
|
|
{
|
|
job_name = "node-exporter";
|
|
static_configs = [{
|
|
targets = [ "127.0.0.1:9002" ];
|
|
}];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
} |