diff --git a/modules/monitoring.nix b/modules/monitoring.nix new file mode 100644 index 0000000..d3cdb3e --- /dev/null +++ b/modules/monitoring.nix @@ -0,0 +1,23 @@ +{ config, pkgs, ... }: + let + domain = "monitoring.${config.networking.domain}"; + in { + # grafana configuration + services.grafana = { + enable = true; + port = 2342; + }; + + services.prometheus = { + enable = true; + port = 9001; + }; + + # nginx reverse proxy + services.nginx.virtualHosts.${domain} = { + locations."/" = { + proxyPass = "http://localhost:${toString config.services.grafana.port}"; + proxyWebsockets = true; + }; + }; +}