nixos/forgejo.nix
agent a3c730e1db Move all services from srazka.com to reudy.net
Renames every domain in the config: Caddy virtual hosts (auth, hello,
nextcloud, git, panel), the ACME contact email, Authelia's session cookie
domain / portal URL / default redirect and TOTP issuer, Nextcloud's
hostName and overwritehost, and Forgejo's DOMAIN (ROOT_URL and ssh clone
URLs follow from it; the panel picks them up via panel.nix). Panel docs and
examples updated too, and a README paragraph that had run together is
split again.

Requires DNS for auth/hello/nextcloud/git/panel.reudy.net (or a
*.reudy.net wildcard) pointing at the server before deploying.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UbWSNkXxZhYf7eqHTyx3Bf
2026-09-27 15:32:49 +00:00

42 lines
1.1 KiB
Nix

{ config, ... }:
let
domain = "git.reudy.net";
sshPort = 14922;
in
{
services.forgejo = {
enable = true;
# SQLite is plenty for a single-user VPS, same as Nextcloud/Authelia.
database.type = "sqlite3";
# Git LFS support for large files.
lfs.enable = true;
settings = {
server = {
DOMAIN = domain;
ROOT_URL = "https://${domain}/";
# Caddy terminates TLS and proxies to this; not reachable from outside.
HTTP_ADDR = "127.0.0.1";
HTTP_PORT = 14921;
# Forgejo's built-in SSH server, separate from the system sshd (which
# only allows 'reudy' on 14902). Clone URLs look like:
# ssh://git@git.reudy.net:14922/<user>/<repo>.git
START_SSH_SERVER = true;
SSH_PORT = sshPort;
SSH_LISTEN_PORT = sshPort;
BUILTIN_SSH_SERVER_USER = "git";
};
# Private instance — create accounts with the admin CLI instead.
service.DISABLE_REGISTRATION = true;
session.COOKIE_SECURE = true;
};
};
networking.firewall.allowedTCPPorts = [ sshPort ];
}