nixos-config/configs/workhorse/grafana.nix
2019-10-24 02:24:33 +02:00

39 lines
881 B
Nix

{ config, ... }:
{
services.nginx = {
enable = true;
statusPage = true;
virtualHosts = {
"grafana.${config.networking.hostName}.private" = {
serverAliases = [];
locations."/" = {
proxyPass = "http://${config.networking.hostName}.private:${toString config.services.grafana.port}";
};
};
};
};
services.grafana = {
enable = true;
port = 5656;
addr = config.module.cluster.services.tinc."private".hosts."${config.networking.hostName}".tincIp;
auth.anonymous = {
enable = true;
org_role = "Editor";
org_name = "AWESOME";
};
provision = {
enable = true;
datasources = [
{
type = "prometheus";
isDefault = true;
name = "Prometheus Workhorse";
url = "http://workhorse.private:9090";
}
];
};
};
}