aether/modules/forgejo.nix

72 lines
1.7 KiB
Nix
Raw Normal View History

2024-07-21 01:44:38 -04:00
{ config, ... }:
let
cfg = config.services.forgejo;
srv = cfg.settings.server;
in {
services.nginx.virtualHosts.${srv.DOMAIN} = {
forceSSL = true;
enableACME = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/".proxyPass = "http://localhost:${builtins.toString srv.HTTP_PORT}";
};
services.forgejo = {
enable = true;
2024-07-22 02:24:47 -04:00
user = "git";
group = cfg.user;
database.user = cfg.user;
2024-07-21 01:44:38 -04:00
settings = {
2024-07-22 02:26:05 -04:00
DEFAULT.APP_NAME = "Code by toki!";
2024-07-21 01:44:38 -04:00
server = {
DOMAIN = "git.tokinanpa.dev";
ROOT_URL = "https://${srv.DOMAIN}/";
};
2024-07-22 02:26:05 -04:00
service.DISABLE_REGISTRATION = true;
2024-07-21 01:44:38 -04:00
repository = {
2024-07-22 02:26:05 -04:00
DEFAULT_REPO_UNITS = "repo.code,repo.issues,repo.pulls";
2024-07-21 01:44:38 -04:00
ENABLE_PUSH_CREATE_USER = true;
DEFAULT_PUSH_CREATE_PRIVATE = false;
2024-07-22 02:26:05 -04:00
PREFERRED_LICENSES = "MIT,GPL-3.0-or-later";
};
mirror.DEFAULT_INTERVAL = "1h";
indexer = {
REPO_INDEXER_ENABLED = true;
REPO_INDEXER_EXCLUDE = "**.pdf, **.png, **.jpg, **.jpeg, **.svg, **.web, **.gpg, **.age";
2024-07-21 01:44:38 -04:00
};
ui = {
DEFAULT_THEME = "forgejo-dark";
2024-07-22 02:26:05 -04:00
GRAPH_MAX_COMMIT_NUM = 250;
};
"ui.meta" = {
AUTHOR = "Kiana Sheibani";
DESCRIPTION = "Code by toki! Powered by Forgejo";
KEYWORDS = "git,forge,forgejo,toki,tokinanpa";
2024-07-21 01:44:38 -04:00
};
2024-07-22 02:26:05 -04:00
"service.explore".DISABLE_USERS_PAGE = true;
2024-07-21 01:44:38 -04:00
2024-07-22 02:26:05 -04:00
federation.ENABLED = true;
2024-07-21 01:44:38 -04:00
};
};
2024-07-22 02:24:47 -04:00
users.users.${cfg.user} = {
home = cfg.stateDir;
useDefaultShell = true;
group = cfg.group;
isSystemUser = true;
};
users.groups.${cfg.group} = {};
services.openssh.enable = true;
services.openssh.settings.AcceptEnv = "GIT_PROTOCOL";
2024-07-21 01:44:38 -04:00
}