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, ... }:
{
let
cfg = config.services.grafana;
in {
services.grafana = {
enable = true;
settings.server = {
@ -35,12 +37,12 @@
};
};
services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = {
services.nginx.virtualHosts.${cfg.settings.server.domain} = {
enableACME = true;
forceSSL = true;
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;
extraConfig = ''
proxy_buffers 8 1024k;

View File

@ -1,6 +1,8 @@
{ config, pkgs, ... }:
{
let
cfg = config.services.loki;
in {
services.loki = {
enable = true;
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, ... }:
{
let
cfg = config.services.prometheus;
in {
services.prometheus = {
enable = true;
listenAddress = "127.0.0.1";
@ -12,7 +14,7 @@
static_configs = [
{
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"
"knakelibrak.pvv.ntnu.no:9100"
];