mirror of
https://git.gay/xqtc/nixos-config
synced 2024-11-23 01:50:33 +01:00
59 lines
1.2 KiB
Nix
59 lines
1.2 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
networking.firewall.allowedTCPPorts = [80 443 9001];
|
|
services.grafana = {
|
|
enable = true;
|
|
port = 2342;
|
|
addr = "127.0.0.1";
|
|
domain = "grafana.heroin.trade";
|
|
analytics.reporting.enable = false;
|
|
};
|
|
|
|
systemd.services.promtail = {
|
|
description = "Promtail service for Loki";
|
|
wantedBy = ["multi-user.target"];
|
|
|
|
serviceConfig = {
|
|
ExecStart = ''
|
|
${pkgs.grafana-loki}/bin/promtail --config.file ${./config-files/promtail.yaml}
|
|
'';
|
|
};
|
|
};
|
|
|
|
services.loki = {
|
|
enable = true;
|
|
configFile = ./config-files/loki-config.yaml;
|
|
};
|
|
|
|
services.prometheus = {
|
|
enable = true;
|
|
port = 9001;
|
|
exporters = {
|
|
node = {
|
|
enable = true;
|
|
enabledCollectors = ["systemd" "sysctl" "powersupplyclass"];
|
|
port = 9002;
|
|
};
|
|
wireguard = {
|
|
enable = true;
|
|
};
|
|
};
|
|
scrapeConfigs = [
|
|
{
|
|
job_name = "beleth";
|
|
static_configs = [
|
|
{
|
|
targets = [
|
|
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
|
|
# "127.0.0.1:${toString config.services.prometheus.exporters.wireguard.port}"
|
|
];
|
|
}
|
|
];
|
|
}
|
|
];
|
|
};
|
|
}
|