configuration.nix/hosts/wynne/services/apps/forgejo.nix

64 lines
1.6 KiB
Nix
Raw Normal View History

{ pkgs, config, lib, ... }:
2024-09-23 20:48:06 +05:30
let
cfg = config.services.forgejo;
domainName = "forge.acomputer.lol";
2024-09-23 20:48:06 +05:30
in
{
sops.secrets = {
"forgejo/runner_registration_token_file" = {
mode = "400";
owner = config.users.users.root.name;
group = config.users.users.root.group;
};
};
2024-09-23 20:48:06 +05:30
services = {
gitea-actions-runner = {
package = pkgs.forgejo-runner;
instances = {
runner-x86_64 = {
enable = true;
name = "runner-x86_64";
labels = [
"docker:docker://debian:stable"
"docker-amd64:docker://debian:stable"
];
tokenFile = config.sops.secrets."forgejo/runner_registration_token_file".path;
url = "https://forge.acomputer.lol";
};
};
};
2024-09-23 20:48:06 +05:30
forgejo = {
enable = true;
package = pkgs.forgejo;
2024-09-23 20:48:06 +05:30
stateDir = "/mnt/data/Forgejo";
settings = {
database = {
DB_TYPE = lib.mkForce "postgres";
HOST = "127.0.0.1:5432";
USER = cfg.database.user;
NAME = cfg.database.name;
};
server = {
ROOT_URL = "https://${domainName}";
PROTOCOL = "http";
2024-10-29 09:54:38 +05:30
DISABLE_SSH = false;
START_SSH_SERVER = true;
BUILTIN_SSH_SERVER_USER = "forge";
2024-09-23 20:48:06 +05:30
SSH_PORT = 42069;
2024-10-29 09:54:38 +05:30
SSH_LISTEN_HOST = "10.10.10.13";
HTTP_ADDR = "10.10.10.13";
2024-09-23 20:48:06 +05:30
HTTP_PORT = 3000;
DOMAIN = domainName;
};
session = {
COOKIE_SECURE = true;
};
service = {
DISABLE_REGISTRATION = true;
};
};
database.createDatabase = true;
};
};
}