2024-11-15 17:56:08 +00:00
|
|
|
{ lib, pkgs, config, ... }:
|
|
|
|
let
|
2024-11-15 21:38:36 +00:00
|
|
|
domain = "forge.tiqa.fr";
|
2024-11-15 17:56:08 +00:00
|
|
|
srv = config.services.forgejo.settings.server;
|
|
|
|
in
|
|
|
|
{
|
2024-11-15 21:45:03 +00:00
|
|
|
security.acme = {
|
|
|
|
defaults.email = "jalil@arfaoui.net";
|
|
|
|
certs = {
|
|
|
|
"forge.tiqa.fr" = {};
|
|
|
|
};
|
|
|
|
acceptTerms = true;
|
|
|
|
};
|
|
|
|
|
2024-11-15 17:56:08 +00:00
|
|
|
services.nginx = {
|
2024-11-15 21:36:20 +00:00
|
|
|
enable = true;
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
|
2024-11-15 21:38:36 +00:00
|
|
|
virtualHosts.${domain} = {
|
2024-11-15 17:56:08 +00:00
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
extraConfig = ''
|
|
|
|
client_max_body_size 512M;
|
|
|
|
'';
|
|
|
|
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-11-15 21:18:48 +00:00
|
|
|
users.groups.forgejo = {};
|
|
|
|
users.users.forgejo = {
|
|
|
|
isSystemUser = true;
|
|
|
|
useDefaultShell = true;
|
|
|
|
group = "forgejo";
|
|
|
|
home = config.services.forgejo.stateDir;
|
|
|
|
};
|
|
|
|
|
2024-11-15 17:56:08 +00:00
|
|
|
services.forgejo = {
|
|
|
|
enable = true;
|
|
|
|
database.type = "postgres";
|
|
|
|
# Enable support for Git Large File Storage
|
|
|
|
lfs.enable = true;
|
|
|
|
settings = {
|
2024-11-15 23:17:21 +00:00
|
|
|
DEFAULT = {
|
|
|
|
APP_NAME = "La Forge de Tiqa";
|
|
|
|
};
|
2024-11-15 17:56:08 +00:00
|
|
|
server = {
|
2024-11-15 21:38:36 +00:00
|
|
|
DOMAIN = domain;
|
2024-11-15 17:56:08 +00:00
|
|
|
# You need to specify this to remove the port from URLs in the web UI.
|
2024-11-15 21:38:36 +00:00
|
|
|
ROOT_URL = "https://${domain}/";
|
2024-11-15 17:56:08 +00:00
|
|
|
HTTP_PORT = 3000;
|
2024-11-15 23:17:21 +00:00
|
|
|
LANDING_PAGE = "explore";
|
2024-11-15 17:56:08 +00:00
|
|
|
};
|
2024-11-15 23:06:06 +00:00
|
|
|
service = {
|
|
|
|
DISABLE_REGISTRATION = true;
|
2024-11-19 09:53:20 +00:00
|
|
|
ACTIVE_CODE_LIVE_MINUTES = 1440;
|
|
|
|
RESET_PASSWD_CODE_LIVE_MINUTES = 1440;
|
|
|
|
ENABLE_NOTIFY_MAIL = true;
|
|
|
|
DEFAULT_ALLOW_CREATE_ORGANIZATION = false;
|
|
|
|
DEFAULT_USER_IS_RESTRICTED = true;
|
|
|
|
DEFAULT_USER_VISIBILITY = "private";
|
|
|
|
DEFAULT_ORG_VISIBILITY = "private";
|
|
|
|
};
|
|
|
|
"service.explore" = {
|
|
|
|
DISABLE_USERS_PAGE = true;
|
2024-11-15 23:06:06 +00:00
|
|
|
};
|
2024-11-15 17:56:08 +00:00
|
|
|
# Add support for actions, based on act: https://github.com/nektos/act
|
|
|
|
actions = {
|
|
|
|
ENABLED = true;
|
|
|
|
DEFAULT_ACTIONS_URL = "github";
|
|
|
|
};
|
2024-11-15 23:18:54 +00:00
|
|
|
"ui.meta" = {
|
2024-11-15 23:17:21 +00:00
|
|
|
AUTHOR = "Jalil Arfaoui";
|
|
|
|
DESCRIPTION = "La Forge de Jalil Arfaoui";
|
|
|
|
};
|
2024-11-15 17:56:08 +00:00
|
|
|
# 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 = true;
|
2024-11-15 22:05:09 +00:00
|
|
|
SMTP_ADDR = "smtp.gmail.com";
|
2024-11-15 17:56:08 +00:00
|
|
|
FROM = "jalil@arfaoui.net";
|
|
|
|
USER = "jalil@arfaoui.net";
|
|
|
|
};
|
|
|
|
};
|
2024-11-15 21:30:20 +00:00
|
|
|
mailerPasswordFile = config.users.users.forgejo.home + "/forgejoMailerPassword";
|
2024-11-15 17:56:08 +00:00
|
|
|
};
|
|
|
|
|
2024-11-15 17:58:04 +00:00
|
|
|
# age.secrets.forgejo-mailer-password = {
|
|
|
|
# file = /root/forgejoMailerPassord;
|
|
|
|
# mode = "400";
|
|
|
|
# owner = "forgejo";
|
|
|
|
# };
|
2024-11-15 17:56:08 +00:00
|
|
|
}
|