1
0
Fork 0
This commit is contained in:
Lukas Wurzinger 2025-03-23 22:48:46 +01:00
parent 616f310f4a
commit 1555d7b643
No known key found for this signature in database
51 changed files with 243 additions and 231 deletions

View file

@ -1,13 +1,11 @@
{
config,
lib,
...
}: {
{config, ...}: let
virtualHostName = "grafana.helveticanonstandard.net";
in {
services.grafana = {
enable = true;
settings.server = {
domain = "grafana.pele";
domain = virtualHostName;
http_port = 9010;
http_addr = "127.0.0.1";
root_url = "http://192.168.1.10:8010"; # TODO
@ -23,24 +21,24 @@
name = "Prometheus";
type = "prometheus";
access = "proxy";
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
url = "http://127.0.0.1:${builtins.toString config.services.prometheus.port}";
}
{
name = "Loki";
type = "loki";
access = "proxy";
url = "http://127.0.0.1:${toString config.services.loki.configuration.server.http_listen_port}";
url = "http://127.0.0.1:${builtins.toString config.services.loki.configuration.server.http_listen_port}";
}
];
};
};
services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = {
services.nginx.virtualHosts.${virtualHostName} = {
locations."/" = {
proxyPass = "http://${lib.formatHostPort {
proxyPass = let
host = config.services.grafana.settings.server.http_addr;
port = config.services.grafana.settings.server.http_port;
}}";
port = builtins.toString config.services.grafana.settings.server.http_port;
in "http://${host}:${port}";
proxyWebsockets = true;
};
};

View file

@ -1,8 +1,4 @@
{
config,
lib,
...
}: {
{config, ...}: {
services.prometheus = {
enable = true;
port = 3020;
@ -22,11 +18,9 @@
static_configs = [
{
targets = let
target = lib.formatHostPort {
host = config.services.prometheus.exporters.node.listenAddress;
inherit (config.services.prometheus.exporters.node) port;
};
in [target];
host = config.services.prometheus.exporters.node.listenAddress;
port = builtins.toString config.services.prometheus.exporters.node.port;
in ["${host}:${port}"];
}
];
}

View file

@ -1,12 +0,0 @@
{
services.tailscale = {
enable = true;
openFirewall = true; #TODO
};
networking.firewall = {
checkReversePath = "loose";
trustedInterfaces = ["tailscale0"];
allowedUDPPorts = [config.services.tailscale.port];
};
}