nixos-configs/devices/nos/modules/docker/forgejo/compose.nix

83 lines
1.8 KiB
Nix
Raw Permalink Normal View History

2024-07-24 15:49:31 -04:00
{
config,
pkgs,
...
}: let
inherit (config.sops) secrets;
2024-07-24 15:49:31 -04:00
inherit (config.khepri) rwDataDir;
rwPath = rwDataDir + "/forgejo";
2024-01-07 04:37:11 -05:00
in {
khepri.compositions."forgejo" = {
networks.proxy_net = {external = true;};
services = {
"forgejo" = {
image = import ./images/forgejo.nix pkgs;
ports = [
# Redirect WAN port 22 to this port
"2222:22"
"3000:3000"
];
networks = ["proxy_net"];
restart = "always";
dependsOn = ["forgejo-db"];
environmentFiles = [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-07 04:37:11 -05:00
};
"forgejo-db" = {
image = import ./images/postgres.nix pkgs;
2024-01-07 04:37:11 -05:00
restart = "always";
2024-01-07 04:37:11 -05:00
environmentFiles = [secrets.forgejo-db.path];
networks = ["proxy_net"];
2024-01-07 04:37:11 -05:00
volumes = ["${rwPath}/db:/var/lib/postgresql/data"];
};
"act_runner" = {
image = import ./images/act_runner.nix pkgs;
2024-01-07 04:37:11 -05:00
privileged = true;
user = "root:root";
networks = ["proxy_net"];
2024-07-24 15:49:31 -04:00
restart = "always";
dependsOn = ["forgejo"];
environmentFiles = [secrets.forgejo-runner.path];
environment = {
GITEA_INSTANCE_URL = "https://git.nelim.org";
GITEA_RUNNER_NAME = "DinD";
};
2024-01-07 04:37:11 -05:00
volumes = ["${rwPath}/act:/data"];
extraHosts = ["git.nelim.org:10.0.0.130"];
};
2024-01-07 04:37:11 -05:00
};
};
}