mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git
synced 2024-11-26 12:51:30 +00:00
32 lines
691 B
Nix
32 lines
691 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;
|
|
};
|
|
};
|
|
scrapeConfigs = [
|
|
{
|
|
job_name = "node-exporter";
|
|
static_configs = [{
|
|
targets = [ "127.0.0.1:9002" ];
|
|
}];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
} |