tlaternet-server/configuration/services/gitea.nix

69 lines
2 KiB
Nix
Raw Normal View History

2022-02-02 19:19:21 +00:00
{ config, pkgs, ... }:
2021-04-12 01:41:31 +01:00
2022-02-02 19:19:21 +00:00
let inherit (pkgs) dockerTools;
in {
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" ];
network = "slirp4netns";
2021-04-12 01:41:31 +01:00
containers = {
gitea = {
image = "gitea/gitea:latest";
2022-02-02 19:19:21 +00:00
imageFile = dockerTools.pullImage {
imageName = "gitea/gitea";
imageDigest =
"sha256:67ccf27b427ec65fd7378d0999a3d94e9649f1953d2bb115864faa71ce7b9ec2";
sha256 = "1nmmb14lpvk2161q2gww5hppn2sa9qcq78k04c011szx07afq2jy";
finalImageName = "gitea/gitea";
finalImageTag = "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 = "localhost:5432";
2021-04-12 01:41:31 +01:00
DB_NAME = "gitea";
DB_USER = "gitea";
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";
};
};
postgres = {
image = "postgres:alpine";
2022-02-02 19:19:21 +00:00
imageFile = dockerTools.pullImage {
imageName = "postgres";
imageDigest =
"sha256:578ca5c8452c08a4e0f5e65b55dce5e1812fe63c8fee40ea837641031598e51e";
sha256 = "1xqg228a29qn3qmzchg65ykx7g3s2fszwp1zv24wxxy40py0bmwk";
finalImageName = "postgres";
finalImageTag = "alpine";
};
2021-04-12 01:41:31 +01:00
environment = {
POSTGRES_DB = "gitea";
POSTGRES_USER = "gitea";
2022-02-02 19:19:21 +00:00
POSTGRES_PASSWORD = "insecure";
2021-04-12 01:41:31 +01:00
};
2022-01-18 18:46:37 +00:00
volumes = [ "gitea-postgres-14:/var/lib/postgresql/data" ];
2021-04-12 01:41:31 +01:00
};
};
};
}