From 46ab9b6881a02878001c577930a8d13bd2516a7f Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Wed, 17 Jul 2024 22:33:18 +0530 Subject: [PATCH] rico0: enable grafana --- hosts/rico0/services/apps/blocky.nix | 1 + hosts/rico0/services/apps/default.nix | 2 +- hosts/rico0/services/apps/grafana.nix | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 hosts/rico0/services/apps/grafana.nix diff --git a/hosts/rico0/services/apps/blocky.nix b/hosts/rico0/services/apps/blocky.nix index 5be548c..a715e48 100644 --- a/hosts/rico0/services/apps/blocky.nix +++ b/hosts/rico0/services/apps/blocky.nix @@ -52,6 +52,7 @@ _: { mapping = { "frp.labs.adtya.xyz" = "10.10.10.10,fd7c:585c:c4ae::10"; "blocky.labs.adtya.xyz" = "10.10.10.10,fd7c:585c:c4ae::10"; + "grafana.labs.adtya.xyz" = "10.10.10.10,fd7c:585c:c4ae::10"; "prometheus.labs.adtya.xyz" = "10.10.10.10,fd7c:585c:c4ae::10"; "transmission.labs.adtya.xyz" = "10.10.10.14,fd7c:585c:c4ae::14"; }; diff --git a/hosts/rico0/services/apps/default.nix b/hosts/rico0/services/apps/default.nix index d0d33f0..bf2d46a 100644 --- a/hosts/rico0/services/apps/default.nix +++ b/hosts/rico0/services/apps/default.nix @@ -1,3 +1,3 @@ _: { - imports = [ ./blocky.nix ./prometheus.nix ]; + imports = [ ./blocky.nix ./grafana.nix ./prometheus.nix ]; } diff --git a/hosts/rico0/services/apps/grafana.nix b/hosts/rico0/services/apps/grafana.nix new file mode 100644 index 0000000..e1685c0 --- /dev/null +++ b/hosts/rico0/services/apps/grafana.nix @@ -0,0 +1,22 @@ +_: { + services = { + caddy = { + virtualHosts."grafana.labs.adtya.xyz" = { + extraConfig = '' + reverse_proxy 127.0.0.1:9091 + tls /persist/secrets/caddy/certs/default.crt /persist/secrets/caddy/certs/default.key + ''; + }; + }; + grafana = { + enable = true; + settings = { + server = { + domain = "grafana.labs.adtya.xyz"; + http_addr = "127.0.0.1"; + http_port = 9091; + }; + }; + }; + }; +}