rice/hosts/ami/forgejo.nix

66 lines
1.6 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 = {
DEFAULT = {
APP_NAME = "buffet's kitchen";
};
server = {
DOMAIN = "buffets.kitchen";
ROOT_URL = "https://buffets.kitchen/";
2024-03-29 20:56:26 +00:00
HTTP_PORT = port;
};
"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;
};
service.REGISTER_MANUAL_CONFIRM = true;
2024-03-29 20:56:26 +00:00
cron.ENABLED = true;
federation.ENABLED = true;
2024-01-25 15:54:05 +00:00
};
};
nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
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."= /" = {
extraConfig = ''
return 301 https://$host/chef;
'';
};
2024-01-25 15:54:05 +00:00
locations."/" = {
proxyPass = "http://localhost:${toString port}";
};
};
};
};
}