feat: forgejo runner

Added a forgejo runner and extracted monolith file into folder/sub-folder
This commit is contained in:
Finn Linck Ryan 2026-01-11 20:52:16 +00:00
parent 2637817c9c
commit eb7d6c146f
9 changed files with 114 additions and 32 deletions

View file

@ -0,0 +1,73 @@
{ config
, lib
, pkgs
, ...
}:
{
services.forgejo = {
enable = true;
user = "forgejo";
group = "forgejo";
database = {
type = "postgres";
host = "/run/postgresql";
name = "forgejo";
user = "forgejo";
};
lfs.enable = false;
settings = {
server = {
DOMAIN = "localhost";
PROTOCOL = "http";
HTTP_PORT = 3000;
# Used for web-displayed URL references.
ROOT_URL = "https://git.dokkae.com/";
# SSH Settings
SSH_DOMAIN = "ssh.dokkae.com";
SSH_PORT = 22;
START_SSH_SERVER = false;
};
services = {
# Can be temporarily disabled to allow registration of an admin user.
# Admin account can manually create new users via web interface.
DISABLE_REGISTRATION = true;
};
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "github";
};
# Optional email server configuration.
# Test mails can be sent via: Profile Picture > Site Administration > Configuration > Mailer Configuration
mailer = {
ENABLED = true;
SMTP_ADDR = "smtp.gmail.com";
FROM = "noreply@git.dokkae.com";
USER = "finnliry@gmail.com";
PROTOCOL = "smtps";
SMTP_PORT = 465;
};
};
secrets = {
mailer.PASSWD = config.sops.secrets."forgejo/mailer/password".path;
};
};
systemd.services.forgejo.preStart = let
adminCmd = "${lib.getExe config.services.forgejo.package} admin user";
pwdPath = config.sops.secrets."forgejo/admin/dokkae.cat/password".path;
user = "dokkae.cat";
in ''
PASSWORD="$(cat "${pwdPath}" | tr -d '\n')"
${adminCmd} create --admin --email "finnliry@gmail.com" --username ${user} --password "$PASSWORD" || true
'';
}