From a21de59c5d4af7b33a22cc98cd29c261652322f4 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 14 Jun 2022 17:58:05 +0200 Subject: [PATCH 1/2] 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"]; }; From ab311adbb66f10f971f16668f6edafad4aa22df2 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 14 Jun 2022 18:06:53 +0200 Subject: [PATCH 2/2] hades: enable postgres backups --- hosts/hades/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts/hades/default.nix b/hosts/hades/default.nix index a0bb987..46d7524 100644 --- a/hosts/hades/default.nix +++ b/hosts/hades/default.nix @@ -73,6 +73,10 @@ in { privatePort = 8080; }; + postgresql-backup = { + enable = true; + }; + restic-backup = { enable = true; repo = "b2:hades-backup-alarsyo";