2023-12-26 16:35:33 +01:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
outputs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
imports = [];
|
2024-01-02 12:12:46 +01:00
|
|
|
users.groups.gitea = {};
|
2023-12-26 16:35:33 +01:00
|
|
|
users.users = {
|
|
|
|
gitea = {
|
2024-01-18 23:58:13 +01:00
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCnYgErCnva8fvLvsmTMC6dHJp2Fvwja0BYL8K/58ugDxNA0PVGj5PpEMar5yhi4AFGGYL4EgD75tRgI/WQU87ZiKjJ6HFIhgX9curncB2kIJ0JoA+FIQMNOT72GFuhjcO4svanrobsMrRmcn193suXY/N6m6F+3pitxBfHPWuPKKjlZqVBzpqCdz9pXoGOk48OSYv7Zyw8roVsUw3fqJqs68LRLM/winWVhVSPabXGyX7PAAW51Nbv6M64REs+V1a+wGvK5sGhRy7lIBAIuD22tuL4/PZojST1hasKN+7cSp7F1QTi4u0yeQ2+gIclQNuhfvghzl6zcVEpOycFouSIJaJjo8jyuHkbm4I2XfALVTFHe7sLpYNNS7Mf6E6i5rHvAvtXI4UBx/LjgPOj7RWZFaotxQRk1D+N0y2xNrO4ft6mS+hrJ/+ybp1XTGdtlkpUDKjiTZkV7Z4fq9J0jtijvtxRfcPhjia50IIHtZ28wVBMCCwYzh5pR15F/XbvKCc= lillian@EDI"
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC7+LEQnC/nlYp7nQ4p6hUCqaGiqfsA3Mg8bSy+zA8Fj lillian@GLaDOS"
|
|
|
|
];
|
2023-12-26 16:35:33 +01:00
|
|
|
isSystemUser = true;
|
|
|
|
isNormalUser = false;
|
2024-01-02 12:12:03 +01:00
|
|
|
group = "gitea";
|
2023-12-26 16:35:33 +01:00
|
|
|
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 = {
|
2023-12-26 16:35:33 +01:00
|
|
|
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";
|
2023-12-26 16:35:33 +01:00
|
|
|
#TODO: different mail passwords for different services
|
2024-01-02 13:05:08 +01:00
|
|
|
mailerPasswordFile = config.sops.secrets."mailpassunhash".path;
|
2023-12-26 16:35:33 +01:00
|
|
|
database = {
|
2024-01-02 12:08:24 +01:00
|
|
|
user = "gitea";
|
2024-01-02 12:11:17 +01:00
|
|
|
name = "gitea";
|
2023-12-26 16:35:33 +01:00
|
|
|
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;
|
|
|
|
};
|
2023-12-29 23:28:17 +01:00
|
|
|
};
|
2023-12-26 16:35:33 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx = {
|
|
|
|
virtualHosts = {
|
|
|
|
"git.lillianviolet.dev" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://localhost:3218";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|