1
0
Fork 0
nixos-config/nixos/roles/monitoring/default.nix
2021-09-24 00:12:53 +02:00

39 lines
856 B
Nix

{ config, pkgs, ... }:
let
commonOptions = {
enableACME = true;
forceSSL = true;
extraConfig = ''
satisfy any;
allow ${config.m-0.prefix}::/64;
deny all;
'';
basicAuthFile = pkgs.privateFile "basic-auth/monitoring";
};
in
{
imports = [
./alertmanager.nix
./grafana.nix
./prometheus.nix
./probes.nix
];
services = {
nginx = {
enable = true;
virtualHosts."alerts.maralorn.de" = {
locations."/".proxyPass = "http://localhost:9093";
} // commonOptions;
virtualHosts."stats.maralorn.de" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:3000/";
};
virtualHosts."monitoring.maralorn.de" = {
locations."/".proxyPass = "http://localhost:9090";
} // commonOptions;
};
};
}