From 961d5f430ff2de8ed32c13f58bf5c9ea0a99a525 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Fri, 11 Jul 2025 21:15:24 +0200 Subject: [PATCH] Services/Gitea: Update to v1.24.2 --- system/services/gitea.nix | 146 ++++++++++++++++++++------------------ 1 file changed, 75 insertions(+), 71 deletions(-) diff --git a/system/services/gitea.nix b/system/services/gitea.nix index a2f544ac..635a5b79 100644 --- a/system/services/gitea.nix +++ b/system/services/gitea.nix @@ -3,7 +3,9 @@ lib, pkgs, ... -}: { +}: let + giteaVersion = "1.24.2"; +in { users = { groups.git = {}; @@ -19,83 +21,85 @@ }; }; - virtualisation.oci-containers.containers.gitea-db = { - image = "postgres:14"; - autoStart = true; + virtualisation.oci-containers.containers = { + gitea-db = { + image = "postgres:14"; + autoStart = true; - login = { - # Uses DockerHub by default - # registry = ""; + login = { + # Uses DockerHub by default + # registry = ""; - # DockerHub Credentials - username = "christoph.urlacher@protonmail.com"; - passwordFile = "${config.sops.secrets.docker-password.path}"; + # DockerHub Credentials + username = "christoph.urlacher@protonmail.com"; + passwordFile = "${config.sops.secrets.docker-password.path}"; + }; + + dependsOn = []; + + ports = []; + + volumes = [ + "gitea-db_data:/var/lib/postgresql/data" + ]; + + environment = { + POSTGRES_USER = "gitea"; + POSTGRES_PASSWORD = "gitea"; + POSTGRES_DB = "gitea"; + }; + + extraOptions = [ + "--net=behind-nginx" + ]; }; - dependsOn = []; + gitea = { + image = "gitea/gitea:${giteaVersion}"; + autoStart = true; - ports = []; + login = { + # Uses DockerHub by default + # registry = ""; - volumes = [ - "gitea-db_data:/var/lib/postgresql/data" - ]; + # DockerHub Credentials + username = "christoph.urlacher@protonmail.com"; + passwordFile = "${config.sops.secrets.docker-password.path}"; + }; - environment = { - POSTGRES_USER = "gitea"; - POSTGRES_PASSWORD = "gitea"; - POSTGRES_DB = "gitea"; + dependsOn = [ + "gitea-db" + ]; + + ports = [ + "3000:3000" + + # NOTE: Set .git/config url to ssh://christoph@gitea.local.chriphost.de:222/christoph/.git + "222:222" # Gitea SSH + ]; + + volumes = [ + "/etc/timezone:/etc/timezone:ro" + "/etc/localtime:/etc/localtime:ro" + + "gitea_data:/data" + ]; + + environment = { + USER = "git"; + USER_UID = "500"; + # USER_GID = "100"; + + GITEA__database__DB_TYPE = "postgres"; + GITEA__database__HOST = "gitea-db:5432"; + GITEA__database__NAME = "gitea"; + GITEA__database__USER = "gitea"; + GITEA__database__PASSWD = "gitea"; + }; + + extraOptions = [ + "--net=behind-nginx" + ]; }; - - extraOptions = [ - "--net=behind-nginx" - ]; - }; - - virtualisation.oci-containers.containers.gitea = { - image = "gitea/gitea:latest"; - autoStart = true; - - login = { - # Uses DockerHub by default - # registry = ""; - - # DockerHub Credentials - username = "christoph.urlacher@protonmail.com"; - passwordFile = "${config.sops.secrets.docker-password.path}"; - }; - - dependsOn = [ - "gitea-db" - ]; - - ports = [ - "3000:3000" - - # NOTE: Set .git/config url to ssh://christoph@gitea.local.chriphost.de:222/christoph/.git - "222:222" # Gitea SSH - ]; - - volumes = [ - "/etc/timezone:/etc/timezone:ro" - "/etc/localtime:/etc/localtime:ro" - - "gitea_data:/data" - ]; - - environment = { - USER = "git"; - USER_UID = "500"; - # USER_GID = "100"; - - GITEA__database__DB_TYPE = "postgres"; - GITEA__database__HOST = "gitea-db:5432"; - GITEA__database__NAME = "gitea"; - GITEA__database__USER = "gitea"; - GITEA__database__PASSWD = "gitea"; - }; - - extraOptions = [ - "--net=behind-nginx" - ]; }; }