NixOS-Config/nixos/server/package-configs/forgejo/configuration.nix

83 lines
1.8 KiB
Nix
Raw Normal View History

{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [];
2024-01-02 12:12:46 +01:00
users.groups.gitea = {};
users.users = {
gitea = {
isSystemUser = true;
isNormalUser = false;
2024-01-02 12:12:03 +01:00
group = "gitea";
extraGroups = ["virtualMail"];
};
};
sops.secrets."mailpassunhash".mode = "0440";
sops.secrets."mailpassunhash".owner = config.users.users.virtualMail.name;
networking.firewall.allowedTCPPorts = [2228];
2024-01-18 23:33:22 +01:00
2024-01-02 12:08:24 +01:00
services.forgejo = {
enable = true;
2024-01-02 12:08:24 +01:00
user = "gitea";
2024-01-02 12:09:59 +01:00
group = "gitea";
2024-01-02 12:08:24 +01:00
stateDir = "/var/lib/gitea";
#TODO: different mail passwords for different services
mailerPasswordFile = config.sops.secrets."mailpassunhash".path;
database = {
2024-01-02 12:08:24 +01:00
user = "gitea";
2024-01-02 12:11:17 +01:00
name = "gitea";
type = "postgres";
};
2023-12-29 23:29:41 +01:00
settings = {
2023-12-30 00:24:45 +01:00
"cron.sync_external_users" = {
RUN_AT_START = true;
SCHEDULE = "@every 24h";
UPDATE_EXISTING = true;
};
2024-01-02 13:20:40 +01:00
mailer = {
ENABLED = true;
PROTOCOL = "sendmail";
FROM = "no-reply@git.lillianviolet.dev";
SENDMAIL_PATH = "${pkgs.system-sendmail}/bin/sendmail";
SENDMAIL_ARGS = "-bs";
};
2023-12-30 00:24:45 +01:00
repository = {
ENABLE_PUSH_CREATE_USER = true;
};
2024-01-02 12:24:17 +01:00
federation = {
ENABLED = true;
};
2023-12-30 00:24:45 +01:00
other = {
SHOW_FOOTER_VERSION = false;
};
2023-12-29 23:35:47 +01:00
service.DISABLE_REGISTRATION = true;
2023-12-29 23:29:41 +01:00
server = {
DOMAIN = "git.lillianviolet.dev";
ROOT_URL = "https://git.lillianviolet.dev/";
HTTP_PORT = 3218;
2024-01-18 23:36:48 +01:00
DISABLE_SSH = false;
START_SSH_SERVER = true;
SSH_DOMAIN = "git.lillianviolet.dev:2228";
2023-12-29 23:29:41 +01:00
};
2023-12-29 23:28:17 +01:00
};
};
services.nginx = {
virtualHosts = {
"git.lillianviolet.dev" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:3218";
};
};
};
};
}