2024-03-21 15:00:36 +01:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
{
|
|
|
|
sops.secrets."postgres/gitea_dbpass" = {
|
|
|
|
sopsFile = ../../../.secrets/hetzner/postgres.yaml; # bring your own password file
|
|
|
|
owner = config.services.forgejo.user;
|
|
|
|
};
|
|
|
|
|
|
|
|
services.forgejo = {
|
|
|
|
enable = true;
|
|
|
|
user = "gitea";
|
|
|
|
group = "gitea";
|
|
|
|
stateDir = "/var/lib/gitea";
|
|
|
|
database = {
|
|
|
|
name = "gitea";
|
|
|
|
user = "gitea";
|
|
|
|
type = "postgres";
|
|
|
|
passwordFile = config.sops.secrets."postgres/gitea_dbpass".path;
|
|
|
|
};
|
|
|
|
settings.service.DISABLE_REGISTRATION = true;
|
|
|
|
settings.server = {
|
|
|
|
DOMAIN = "git.hoyer.xyz";
|
|
|
|
ROOT_URL = "https://git.hoyer.xyz/";
|
|
|
|
HTTP_PORT = 3001;
|
|
|
|
};
|
|
|
|
settings.log.LEVEL = "Warn";
|
|
|
|
};
|
|
|
|
|
|
|
|
users.users.gitea = {
|
|
|
|
home = "/var/lib/gitea";
|
|
|
|
useDefaultShell = true;
|
|
|
|
group = "gitea";
|
|
|
|
isSystemUser = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
users.groups.gitea = { };
|
|
|
|
|
|
|
|
services.postgresql = {
|
|
|
|
package = pkgs.postgresql_14;
|
|
|
|
ensureDatabases = [
|
|
|
|
config.services.forgejo.database.name
|
|
|
|
"nextcloud"
|
|
|
|
];
|
|
|
|
ensureUsers = [
|
|
|
|
{
|
|
|
|
name = config.services.forgejo.database.user;
|
|
|
|
ensureDBOwnership = true;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "nextcloud";
|
|
|
|
ensureDBOwnership = true;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-06-27 13:00:32 +02:00
|
|
|
|
|
|
|
sops.secrets."forgejo-runner-token" = {
|
|
|
|
sopsFile = ../../../.secrets/hetzner/forgejo-runner-token.yaml; # bring your own password file
|
|
|
|
};
|
|
|
|
|
|
|
|
services.gitea-actions-runner = {
|
|
|
|
package = pkgs.forgejo-actions-runner;
|
|
|
|
instances.default = {
|
|
|
|
enable = true;
|
|
|
|
name = "base";
|
|
|
|
url = "https://git.hoyer.xyz";
|
|
|
|
tokenFile = config.sops.secrets.forgejo-runner-token.path;
|
2024-06-27 14:23:44 +02:00
|
|
|
settings.container.network = "host";
|
2024-06-27 13:00:32 +02:00
|
|
|
labels = [
|
2024-06-27 13:16:19 +02:00
|
|
|
"ubuntu-latest:docker://gitea/runner-images:ubuntu-latest"
|
|
|
|
"ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04"
|
|
|
|
"ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04"
|
2024-06-27 15:12:12 +02:00
|
|
|
"nix:docker://git.hoyer.xyz/harald/nix-runner:latest"
|
2024-06-27 13:00:32 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2024-03-21 15:00:36 +01:00
|
|
|
}
|