feat(forgejo): install

This commit is contained in:
wi11-holdsworth 2026-02-24 22:09:18 +11:00 committed by Will Holdsworth
parent 6328d80bdf
commit 79dba1beb4
Signed by: will-holdsworth
SSH key fingerprint: SHA256:Ykee8aymMJNAiYeeEmiwcIzkA1wgd4v8OZcWGxjq12c
3 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,48 @@
{
config,
lib,
...
}:
let
port = 5027;
certloc = "/var/lib/acme/fi33.buzz";
hostname = "git.fi33.buzz";
url = "https://git.fi33.buzz";
in
{
services = {
forgejo = {
enable = true;
dump = {
enable = true;
interval = "00:00";
};
lfs.enable = true;
settings = {
server = {
# keep-sorted start
DOMAIN = hostname;
HTTP_PORT = port;
ROOT_URL = url;
SSH_PORT = lib.head config.services.openssh.ports;
# keep-sorted end
};
service.DISABLE_REGISTRATION = true;
};
};
openssh.settings.AllowUsers = [ "forgejo" ];
borgbackup.jobs = {
onsite.paths = [ "/var/lib/forgejo" ];
offsite.paths = [ "/var/lib/forgejo" ];
};
caddy.virtualHosts.${hostname}.extraConfig = ''
reverse_proxy localhost:${toString port}
tls ${certloc}/cert.pem ${certloc}/key.pem {
protocols tls1.3
}
'';
};
}