forgejo-nixos-gandi/forgejo.nix

75 lines
1.9 KiB
Nix

{ lib, pkgs, config, ... }:
let
domain = "forge.tiqa.fr";
srv = config.services.forgejo.settings.server;
in
{
security.acme = {
defaults.email = "jalil@arfaoui.net";
certs = {
"forge.tiqa.fr" = {};
};
acceptTerms = true;
};
services.nginx = {
enable = true;
recommendedGzipSettings = true;
virtualHosts.${domain} = {
forceSSL = true;
enableACME = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
};
};
users.groups.forgejo = {};
users.users.forgejo = {
isSystemUser = true;
useDefaultShell = true;
group = "forgejo";
home = config.services.forgejo.stateDir;
};
services.forgejo = {
enable = true;
database.type = "postgres";
# Enable support for Git Large File Storage
lfs.enable = true;
settings = {
server = {
DOMAIN = domain;
# You need to specify this to remove the port from URLs in the web UI.
ROOT_URL = "https://${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 = 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;
SMTP_ADDR = "mail.infomaniak.com";
FROM = "jalil@arfaoui.net";
USER = "jalil@arfaoui.net";
};
};
mailerPasswordFile = config.users.users.forgejo.home + "/forgejoMailerPassword";
};
# age.secrets.forgejo-mailer-password = {
# file = /root/forgejoMailerPassord;
# mode = "400";
# owner = "forgejo";
# };
}