rice/hosts/ami/forgejo.nix

102 lines
2.3 KiB
Nix
Raw Normal View History

{pkgs, ...}: let
2024-03-29 20:56:26 +00:00
port = 3000;
2024-01-25 15:54:05 +00:00
in {
services = {
2024-03-29 20:56:26 +00:00
forgejo = {
2024-01-25 15:54:05 +00:00
enable = true;
package = pkgs.unstable.forgejo;
2024-03-29 20:56:26 +00:00
settings = {
2024-06-03 07:11:50 +00:00
DEFAULT = {
APP_NAME = "buffet's kitchen";
};
actions = {
ENABLED = false;
};
2024-06-03 07:11:50 +00:00
admin = {
SEND_NOTIFICATION_EMAIL_ON_NEW_USER = true;
};
2024-06-03 07:11:50 +00:00
cron = {
ENABLED = true;
2024-03-29 20:56:26 +00:00
};
2024-06-03 07:11:50 +00:00
federation = {
ENABLED = true;
2024-03-29 20:56:26 +00:00
};
2024-06-03 07:11:50 +00:00
mailer = {
ENABLED = true;
PROTOCOL = "sendmail";
FROM = "buffet's kitchen <do-not-reply@buffets.kitchen>";
SENDMAIL_PATH = "${pkgs.system-sendmail}/bin/sendmail";
2024-05-01 13:33:06 +00:00
};
"markup.asciidoc" = {
ENABLED = true;
NEED_POSTPROCESS = true;
FILE_EXTENSIONS = ".adoc,.asciidoc";
RENDER_COMMAND = ''"${pkgs.asciidoctor}/bin/asciidoctor -e --safe-mode=secure -a showtitle --out-file=- -"'';
IS_INPUT_FILE = false;
};
"markup.restructuredtext" = {
ENABLED = true;
NEED_POSTPROCESS = true;
FILE_EXTENSIONS = ".rst";
RENDER_COMMAND = ''"timeout 30s ${pkgs.pandoc}/bin/pandoc +RTS -M512M -RTS -f rst"'';
IS_INPUT_FILE = false;
};
2024-06-03 07:11:50 +00:00
repository = {
ENABLE_PUSH_CREATE_USER = true;
ENABLE_PUSH_CREATE_ORG = true;
};
"repository.pull-request" = {
DEFAULT_MERGE_STYLE = "rebase";
};
2024-06-03 07:11:50 +00:00
server = {
DOMAIN = "buffets.kitchen";
ROOT_URL = "https://buffets.kitchen/";
HTTP_PORT = port;
LANDING_PAGE = "/kitchen";
};
service = {
DISABLE_REGISTRATION = true;
ENABLE_NOTIFY_MAIL = true;
};
2024-06-21 09:25:02 +00:00
webhook = {
ALLOWED_HOST_LIST = "external,loopback";
};
2024-01-25 15:54:05 +00:00
};
};
nginx = {
2024-03-29 20:56:26 +00:00
virtualHosts."buffets.kitchen" = {
useACMEHost = "buffet.sh";
2024-01-25 15:54:05 +00:00
forceSSL = true;
locations = {
"@forgejo" = {
proxyPass = "http://localhost:${toString port}";
};
"/" = {
tryFiles = "$uri @forgejo";
};
"/assets/" = {
root = ../../res/forgejo;
tryFiles = ''$uri @forgejo'';
};
2024-01-25 15:54:05 +00:00
};
};
};
};
}