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

74 lines
1.6 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;
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;
};
mailer = {
ENABLED = true;
PROTOCOL = "sendmail";
2023-12-30 00:24:45 +01:00
FROM = "no-reply@git.lillianviolet.dev";
2024-01-02 12:16:14 +01:00
SENDMAIL_PATH = "${pkgs.system-sendmail}/bin/sendmail";
2023-12-31 13:42:54 +01:00
SENDMAIL_ARGS = "-bs";
2023-12-30 00:24:45 +01:00
};
repository = {
ENABLE_PUSH_CREATE_USER = true;
};
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;
};
2023-12-29 23:28:17 +01:00
};
};
services.nginx = {
virtualHosts = {
"git.lillianviolet.dev" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:3218";
};
};
};
};
}