2024-01-22 15:50:05 -05:00
|
|
|
{config, ...}: let
|
|
|
|
inherit (config.sops) secrets;
|
|
|
|
inherit (config.arion) rwDataDir;
|
|
|
|
|
|
|
|
rwPath = rwDataDir + "/forgejo";
|
2024-01-07 04:37:11 -05:00
|
|
|
in {
|
2024-01-22 15:50:05 -05:00
|
|
|
arion.projects."forgejo" = {
|
2024-01-07 04:37:11 -05:00
|
|
|
"forgejo" = {
|
2024-01-22 15:50:05 -05:00
|
|
|
image = ./images/forgejo.nix;
|
2024-01-07 04:37:11 -05:00
|
|
|
|
|
|
|
ports = [
|
|
|
|
# Redirect WAN port 22 to this port
|
|
|
|
"2222:22"
|
|
|
|
"3000:3000"
|
|
|
|
];
|
|
|
|
|
|
|
|
restart = "always";
|
|
|
|
depends_on = ["forgejo-db"];
|
|
|
|
|
|
|
|
env_file = [secrets.forgejo.path];
|
|
|
|
environment = {
|
|
|
|
APP_NAME = "Gitea";
|
|
|
|
|
|
|
|
# TODO: change ids
|
|
|
|
USER_UID = "1000";
|
|
|
|
USER_GID = "1000";
|
|
|
|
|
|
|
|
ROOT_URL = "https://git.nelim.org";
|
|
|
|
SSH_DOMAIN = "git.nelim.org";
|
|
|
|
SSH_PORT = 22;
|
|
|
|
HTTP_PORT = 3000;
|
|
|
|
};
|
|
|
|
|
|
|
|
volumes = [
|
|
|
|
"${rwPath}/data:/data"
|
|
|
|
"/etc/timezone:/etc/timezone:ro"
|
|
|
|
"/etc/localtime:/etc/localtime:ro"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-01-08 01:11:22 -05:00
|
|
|
"forgejo-db" = {
|
2024-01-22 15:50:05 -05:00
|
|
|
image = ./images/postgres.nix;
|
2024-01-07 04:37:11 -05:00
|
|
|
|
|
|
|
restart = "always";
|
|
|
|
|
2024-01-08 01:11:22 -05:00
|
|
|
env_file = [secrets.forgejo-db.path];
|
|
|
|
|
|
|
|
volumes = ["${rwPath}/db:/var/lib/postgresql/data"];
|
2024-01-07 04:37:11 -05:00
|
|
|
};
|
|
|
|
|
2024-01-22 15:50:05 -05:00
|
|
|
"act_runner" = {
|
|
|
|
image = ./images/act_runner.nix;
|
2024-01-08 01:11:22 -05:00
|
|
|
privileged = true;
|
|
|
|
|
2024-01-07 04:37:11 -05:00
|
|
|
restart = "always";
|
2024-01-08 01:11:22 -05:00
|
|
|
depends_on = ["forgejo"];
|
2024-01-07 04:37:11 -05:00
|
|
|
|
2024-01-08 01:11:22 -05:00
|
|
|
env_file = [secrets.forgejo-runner.path];
|
|
|
|
environment = {
|
|
|
|
GITEA_INSTANCE_URL = "https://git.nelim.org";
|
|
|
|
GITEA_RUNNER_NAME = "DinD";
|
|
|
|
};
|
2024-01-07 04:37:11 -05:00
|
|
|
|
2024-01-08 01:11:22 -05:00
|
|
|
volumes = ["${rwPath}/act:/data"];
|
2024-05-22 10:05:49 -04:00
|
|
|
|
|
|
|
extra_hosts = [
|
|
|
|
"git.nelim.org=10.0.0.130"
|
|
|
|
];
|
2024-01-07 04:37:11 -05:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|