1
0
Fork 0

Cleanup ildkule configs

This commit is contained in:
Felix Albrigtsen 2022-12-20 21:44:22 +01:00
parent fcdce57a3d
commit a45a08db57
3 changed files with 13 additions and 7 deletions

View File

@ -1,6 +1,8 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ let
cfg = config.services.grafana;
in {
services.grafana = { services.grafana = {
enable = true; enable = true;
settings.server = { settings.server = {
@ -35,12 +37,12 @@
}; };
}; };
services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = { services.nginx.virtualHosts.${cfg.settings.server.domain} = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations = { locations = {
"/" = { "/" = {
proxyPass = "http://127.0.0.1:${toString config.services.grafana.settings.server.http_port}"; proxyPass = "http://127.0.0.1:${toString cfg.settings.server.http_port}";
proxyWebsockets = true; proxyWebsockets = true;
extraConfig = '' extraConfig = ''
proxy_buffers 8 1024k; proxy_buffers 8 1024k;

View File

@ -1,6 +1,8 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ let
cfg = config.services.loki;
in {
services.loki = { services.loki = {
enable = true; enable = true;
configuration = { configuration = {
@ -80,5 +82,5 @@
}; };
}; };
networking.firewall.allowedTCPPorts = [ config.services.loki.configuration.server.http_listen_port ]; networking.firewall.allowedTCPPorts = [ cfg.configuration.server.http_listen_port ];
} }

View File

@ -1,6 +1,8 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ let
cfg = config.services.prometheus;
in {
services.prometheus = { services.prometheus = {
enable = true; enable = true;
listenAddress = "127.0.0.1"; listenAddress = "127.0.0.1";
@ -12,7 +14,7 @@
static_configs = [ static_configs = [
{ {
targets = [ targets = [
"ildkule.pvv.ntnu.no:${toString config.services.prometheus.exporters.node.port}" "ildkule.pvv.ntnu.no:${toString cfg.exporters.node.port}"
"microbel.pvv.ntnu.no:9100" "microbel.pvv.ntnu.no:9100"
"knakelibrak.pvv.ntnu.no:9100" "knakelibrak.pvv.ntnu.no:9100"
]; ];