{ 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; }; nginx.virtualHosts."monitoring.new.hackens.org" = { forceSSL = true; enableACME = true; locations."/" = { proxyPass = "http://localhost:3000"; proxyWebsockets = true; }; }; }; networking.firewall.allowedTCPPorts = [ 3000 ]; }