From 70c96d504ddd1015c5b10e7d31f35f9efcb5c542 Mon Sep 17 00:00:00 2001 From: Rachel Lambda Samuelsson Date: Fri, 24 May 2024 22:54:44 +0200 Subject: [PATCH] successfull interplay between gitea and postgres --- result | 1 + services/gitea.nix | 1 + services/postgres.nix | 11 +++++------ 3 files changed, 7 insertions(+), 6 deletions(-) create mode 120000 result diff --git a/result b/result new file mode 120000 index 0000000..8d0a1a7 --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/cy1mab4p2g1zf38bcdpb3ix034wxs8a8-nixos-vm \ No newline at end of file diff --git a/services/gitea.nix b/services/gitea.nix index 9b38f77..dd92126 100644 --- a/services/gitea.nix +++ b/services/gitea.nix @@ -10,6 +10,7 @@ port = 3306; name = "gitea"; user = "gitea"; + createDatabase = false; passwordFile = ../secrets/gitea_postgres_pass; }; settings.server = { diff --git a/services/postgres.nix b/services/postgres.nix index 218fc7e..56c50d7 100644 --- a/services/postgres.nix +++ b/services/postgres.nix @@ -6,12 +6,11 @@ enableTCPIP = true; port = 3306; ensureDatabases = [ "gitea" ]; - initialScript = pkgs.writeText "backend-initScript" '' - CREATE USER gitea WITH LOGIN PASSWORD '${pkgs.lib.strings.fileContents ../secrets/gitea_postgres_pass}' CREATEDB; - CREATE DATABASE gitea; - GRANT ALL PRIVILEGES ON DATABASE gitea TO gitea; - ''; - authentication = pkgs.lib.mkOverride 10 '' + ensureUsers = [{ + name = "gitea"; + ensureDBOwnership = true; + }]; + authentication = '' host all all 10.10.0.0/16 trust ''; };