From 64e0679ee44a18029bfda5f1baf69b47b4484e95 Mon Sep 17 00:00:00 2001 From: thiloho <123883702+thiloho@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:26:17 +0100 Subject: [PATCH] Add gitea instance --- nixos-configurations/server/default.nix | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/nixos-configurations/server/default.nix b/nixos-configurations/server/default.nix index 59122e2..3b4e91f 100644 --- a/nixos-configurations/server/default.nix +++ b/nixos-configurations/server/default.nix @@ -85,6 +85,11 @@ forceSSL = true; locations."/".proxyPass = "http://localhost:5173"; }; + "git.thilohohlt.com" = { + enableACME = true; + forceSSL = true; + locations."/".proxyPass = "http://localhost:3001"; + }; }; }; hedgedoc = { @@ -104,15 +109,33 @@ }; environmentFile = config.age.secrets.hedgedoc-environment-file.path; }; + gitea = { + enable = true; + appName = "Gitea instance of Thilo"; + database = { + type = "postgres"; + host = "/run/postgresql"; + }; + settings.service.DISABLE_REGISTRATION = true; + settings.server = { + DOMAIN = "thilohohlt.com"; + ROOT_URL = "https://git.thilohohlt.com"; + HTTP_PORT = 3001; + }; + }; postgresql = { enable = true; package = pkgs.postgresql_15; - ensureDatabases = [ "dcbot" "hedgedoc" "todos" ]; + ensureDatabases = [ "dcbot" "hedgedoc" "todos" "gitea" ]; ensureUsers = [ { name = "hedgedoc"; ensurePermissions."DATABASE hedgedoc" = "ALL PRIVILEGES"; } + { + name = "gitea"; + ensurePermissions."DATABASE gitea" = "ALL PRIVILEGES"; + } ]; authentication = lib.mkForce '' #type database DBuser auth-method