From 8f42f9a9b87746e2c726f87e50d2104077b155b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Wed, 11 Mar 2026 13:33:57 -0700 Subject: [PATCH] feat: migrate Grafana to PostgreSQL on glyph Configure Grafana on spore to use centralized PostgreSQL on glyph via Tailscale instead of local SQLite. Add grafana database, user, and backup to glyph's PostgreSQL configuration. Co-Authored-By: Claude Opus 4.6 --- hosts/glyph/services/db.nix | 8 ++++++-- hosts/spore/services/grafana.nix | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/hosts/glyph/services/db.nix b/hosts/glyph/services/db.nix index 21a22c9..2f58da9 100644 --- a/hosts/glyph/services/db.nix +++ b/hosts/glyph/services/db.nix @@ -12,12 +12,16 @@ port = 5432; max_connections = 150; }; - ensureDatabases = ["atticd" "pocketid"]; + ensureDatabases = ["atticd" "grafana" "pocketid"]; ensureUsers = [ { name = "atticd"; ensureDBOwnership = true; } + { + name = "grafana"; + ensureDBOwnership = true; + } { name = "pocketid"; ensureDBOwnership = true; @@ -27,6 +31,6 @@ services.postgresqlBackup = { enable = true; - databases = ["atticd" "pocketid"]; + databases = ["atticd" "grafana" "pocketid"]; }; } diff --git a/hosts/spore/services/grafana.nix b/hosts/spore/services/grafana.nix index 06509e4..2c9b06d 100644 --- a/hosts/spore/services/grafana.nix +++ b/hosts/spore/services/grafana.nix @@ -43,6 +43,13 @@ auto_login = false; skip_org_role_sync = true; }; + database = { + type = "postgres"; + host = "glyph.rove-duck.ts.net:5432"; + name = "grafana"; + user = "grafana"; + ssl_mode = "disable"; + }; security = { admin_user = "corey@zx.dev"; admin_email = "corey@zx.dev";