nixfiles/hosts/hetzner-arm/profiles/forgejo.nix

89 lines
2.1 KiB
Nix
Raw Normal View History

2023-09-30 12:37:07 +01:00
{pkgs, ...}: {
services.forgejo = {
enable = true;
database = {
type = "sqlite3";
};
2023-09-30 12:37:07 +01:00
lfs.enable = true;
settings = {
DEFAULT.APP_NAME = "chaos's Forgejo";
server = rec {
DOMAIN = "forgejo.owo.monster";
ROOT_URL = "https://${DOMAIN}";
# Can't access /run out of container
2024-07-20 12:58:45 +01:00
HTTP_ADDR = "/var/sockets/forgejo/forgejo.sock";
2023-09-30 12:37:07 +01:00
PROTOCOL = "http+unix";
START_SSH_SERVER = true;
SSH_PORT = 2222;
SSH_LISTEN_PORT = SSH_PORT;
OFFLINE_MODE = true;
ENABLE_GZIP = true;
};
repository = {
DISABLED_REPO_UNITS = "repo.ext_issues,repo.pulls,repo.wiki,repo.ext_wiki,repo.projects,repo.packages";
DEFAULT_REPO_UNITS = "repo.code,repo.releases,repo.issues,repo.actions";
};
ui = {
DEFAULT_THEME = "forgejo-dark";
};
"ui.meta" = {
AUTHOR = "chaos's Forgejo";
DESCRIPTION = "chaos's personal Forgejo instance";
KEYWORDS = "";
};
indexer = {
REPO_INDEXER_ENABLED = true;
};
service = {
DISABLE_REGISTRATION = true;
};
"ssh.minimum_key_sizes" = {
ECDSA = -1;
2023-10-23 20:08:10 +01:00
# RSA currently enabled for spicywolf
# RSA = -1;
2023-09-30 12:37:07 +01:00
DSA = -1;
};
session = {
PROVIDER = "db";
};
oauth = {
ENABLE = false;
};
time = {
DEFAULT_UI_LOCATION = "Europe/London";
};
packages = {
ENABLE = false;
};
};
};
environment.systemPackages = [
(pkgs.writeShellScriptBin "forgejo" ''
sudo -u forgejo ${pkgs.forgejo}/bin/gitea -w /var/lib/forgejo "$@"
'')
];
systemd.services.forgejo.serviceConfig.ReadWritePaths = [
2024-07-20 12:58:45 +01:00
"/var/sockets/forgejo"
2023-09-30 12:37:07 +01:00
];
systemd.tmpfiles.rules = [
2024-07-20 12:58:45 +01:00
"d /var/sockets - root root"
"d /var/sockets/forgejo - forgejo forgejo"
2023-09-30 12:37:07 +01:00
];
2024-07-20 12:58:45 +01:00
services.nginx = {
enable = true;
virtualHosts."forgejo.owo.monster" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://unix:/var/sockets/forgejo/forgejo.sock";
};
};
2024-07-20 13:11:15 +01:00
2024-07-20 13:12:02 +01:00
networking.firewall.allowedTCPPorts = [
2024-07-20 13:11:15 +01:00
2222
];
2023-09-30 12:37:07 +01:00
}