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 = {
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
# 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 = true;
|
|
|
|
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 = true;
|
2024-11-15 21:57:59 +00:00
|
|
|
SMTP_ADDR = "mail.infomaniak.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
|
|
|
}
|