forgejo/module.nix: init
This commit is contained in:
parent
a20a0baad7
commit
b599f7e425
1 changed files with 53 additions and 0 deletions
53
modules/services/forgejo/module.nix
Normal file
53
modules/services/forgejo/module.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
{config, ...}: let
|
||||
cfg = config.services.forgejo;
|
||||
srv = cfg.settings.server;
|
||||
in {
|
||||
services.nginx = {
|
||||
virtualHosts.${cfg.settings.server.DOMAIN} = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
extraConfig = ''
|
||||
client_max_body_size 512M;
|
||||
'';
|
||||
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
|
||||
};
|
||||
};
|
||||
|
||||
services.forgejo = {
|
||||
enable = true;
|
||||
database.type = "postgres";
|
||||
# Enable support for Git Large File Storage
|
||||
lfs.enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = "copeberg.org";
|
||||
# You need to specify this to remove the port from URLs in the web UI.
|
||||
ROOT_URL = "https://${srv.DOMAIN}/";
|
||||
HTTP_PORT = 3000;
|
||||
};
|
||||
# You can temporarily allow registration to create an admin user.
|
||||
service.DISABLE_REGISTRATION = true;
|
||||
# Add support for actions, based on act: https://github.com/nektos/act
|
||||
actions = {
|
||||
ENABLED = false;
|
||||
DEFAULT_ACTIONS_URL = "github";
|
||||
};
|
||||
# Sending emails is completely optional
|
||||
# You can send a test email from the web UI at:
|
||||
# Profile Picture > Site Administration > Configuration > Mailer Configuration
|
||||
mailer = {
|
||||
ENABLED = false;
|
||||
# SMTP_ADDR = "mail.example.com";
|
||||
# FROM = "noreply@${srv.DOMAIN}";
|
||||
# USER = "noreply@${srv.DOMAIN}";
|
||||
};
|
||||
};
|
||||
# mailerPasswordFile = config.age.secrets.forgejo-mailer-password.path;
|
||||
};
|
||||
|
||||
# age.secrets.forgejo-mailer-password = {
|
||||
# file = ../secrets/forgejo-mailer-password.age;
|
||||
# mode = "400";
|
||||
# owner = "forgejo";
|
||||
# };
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue