From e7be95a0c1a9089c5faca3a469da4f95f3fbb3a8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 4 Oct 2024 14:24:49 +0800 Subject: [PATCH] !fixup hosts/plover re-enable gitea --- configs/nixos/plover/modules/services/gitea.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/configs/nixos/plover/modules/services/gitea.nix b/configs/nixos/plover/modules/services/gitea.nix index e2beb650..90ccd79f 100644 --- a/configs/nixos/plover/modules/services/gitea.nix +++ b/configs/nixos/plover/modules/services/gitea.nix @@ -106,8 +106,6 @@ in # Session configuration. session.COOKIE_SECURE = true; - # Some more database configuration. - # Run various periodic services. "cron.update_mirrors".SCHEDULE = "@every 3h"; @@ -168,6 +166,13 @@ in ensureDBOwnership = true; }; }; + + systemd.services.gitea.preStart = let + psql = lib.getExe' config.services.postgresql.package "psql"; + schema = config.services.gitea.user; + in lib.mkBefore '' + ${psql} -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${schema};" + ''; }) (lib.mkIf hostCfg.services.reverse-proxy.enable {