From a21de59c5d4af7b33a22cc98cd29c261652322f4 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 14 Jun 2022 17:58:05 +0200 Subject: [PATCH] services: gitea: ensure database exists --- services/gitea/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/gitea/default.nix b/services/gitea/default.nix index c6472fb..0c40c93 100644 --- a/services/gitea/default.nix +++ b/services/gitea/default.nix @@ -95,6 +95,18 @@ in { ]; }; + services.postgresql = { + enable = true; + + ensureDatabases = ["gitea"]; + ensureUsers = [ + { + name = "git"; + ensurePermissions."DATABASE gitea" = "ALL PRIVILEGES"; + } + ]; + }; + services.postgresqlBackup = { databases = ["gitea"]; };