about summary refs log tree commit diff
path: root/modules/services/grafana/default.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/services/grafana/default.nix18
1 files changed, 17 insertions, 1 deletions
diff --git a/modules/services/grafana/default.nix b/modules/services/grafana/default.nix
index 174ece9..bee67bd 100644
--- a/modules/services/grafana/default.nix
+++ b/modules/services/grafana/default.nix
@@ -1,5 +1,7 @@
 { config, lib, pkgs, ... }:
-let cfg = config.my.services.grafana;
+let
+  cfg = config.my.services.grafana;
+  secrets = config.age.secrets;
 in {
   options.my.services.grafana = with lib; {
     enable = mkEnableOption "grafana observability stack";
@@ -29,6 +31,20 @@ in {
       };
     };
 
+    services.nginx.virtualHosts."dash.fcuny.xyz" = {
+      forceSSL = true;
+      enableACME = true;
+      locations."/" = {
+        proxyPass = "http://127.0.0.1:9090";
+        proxyWebsockets = true;
+      };
+    };
+
+    security.acme.certs."dash.fcuny.xyz" = {
+      dnsProvider = "gcloud";
+      credentialsFile = secrets."acme/credentials".path;
+    };
+
     my.services.backup = { paths = [ "/var/lib/grafana" ]; };
   };
 }