40 lines
927 B
Nix
40 lines
927 B
Nix
{ pkgs, lib, config, ... }:
|
|
{
|
|
imports = [ ../modules/mqtt2prometheus ];
|
|
services = {
|
|
prometheus = {
|
|
enable = true;
|
|
listenAddress = "127.0.0.1";
|
|
scrapeConfigs = [
|
|
{
|
|
job_name = "mqtt_listener";
|
|
scrape_interval = "120s";
|
|
static_configs = [
|
|
{
|
|
targets = [
|
|
"localhost:9641"
|
|
];
|
|
}
|
|
];
|
|
}
|
|
];
|
|
};
|
|
mqtt2prometheus = {
|
|
enable = true;
|
|
package = pkgs.callPackage (import ./mqtt2prometheus.nix) { };
|
|
config = ./config.yaml;
|
|
};
|
|
grafana = {
|
|
enable = true;
|
|
};
|
|
services.nginx.virtualHosts."monitoring.new.hackens.org" = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
locations."/" = {
|
|
proxyPass = "http://localhost:3000";
|
|
proxyWebsockets = true;
|
|
};
|
|
};
|
|
};
|
|
networking.firewall.allowedTCPPorts = [ 3000 ];
|
|
}
|