tlaternet-server/configuration/services/gitea.nix

57 lines
1.5 KiB
Nix
Raw Normal View History

2021-04-12 01:41:31 +01:00
{ config, ... }:
{
users = {
extraUsers.gitea = {
uid = config.ids.uids.git;
isSystemUser = true;
description = "Gitea Service";
group = config.users.extraGroups.gitea.name;
};
extraGroups.gitea = { gid = config.ids.gids.git; };
};
2021-04-12 01:41:31 +01:00
virtualisation.pods.gitea = {
hostname = "gitea.tlater.net";
publish = [ "3000:3000" "2221:2221" ];
containers = {
gitea = {
2021-05-15 22:29:02 +01:00
image = "docker.io/gitea/gitea:latest";
2021-04-12 01:41:31 +01:00
volumes = [ "gitea:/data:Z" "/etc/localtime:/etc/localtime:ro" ];
dependsOn = [ "postgres" ];
environment = {
DB_TYPE = "postgres";
DB_HOST = "gitea-postgres:5432";
DB_NAME = "gitea";
DB_USER = "gitea";
DB_PASSWD = "/qNDDK9WCMuubfA7D8DFwfl9T+Gy2IMDvPhiNpcxZjY=";
USER_UID = toString config.users.extraUsers.gitea.uid;
USER_GID = toString config.users.extraGroups.gitea.gid;
2021-04-12 01:41:31 +01:00
RUN_MODE = "prod";
DOMAIN = "gitea.tlater.net";
SSH_PORT = "2221";
};
2021-05-15 22:29:02 +01:00
extraOptions = [
"--replace"
"--label" "io.containers.autoupdate=image"
];
2021-04-12 01:41:31 +01:00
};
postgres = {
image = "postgres:alpine";
environment = {
POSTGRES_DB = "gitea";
POSTGRES_USER = "gitea";
POSTGRES_PASSWORD = "/qNDDK9WCMuubfA7D8DFwfl9T+Gy2IMDvPhiNpcxZjY=";
};
2021-04-17 22:12:41 +01:00
volumes = [ "gitea-db-data:/var/lib/postgresql/data" ];
2021-04-12 01:41:31 +01:00
};
};
};
}