config/modules/services/gitea/default.nix

92 lines
2.4 KiB
Nix
Raw Normal View History

2023-08-24 23:34:48 +03:00
{
config,
lib,
2024-01-17 10:11:13 +02:00
pkgs,
2023-08-24 23:34:48 +03:00
myData,
...
}: {
options.mj.services.gitea = with lib.types; {
enable = lib.mkEnableOption "Enable gitea";
};
config = lib.mkIf config.mj.services.gitea.enable {
users = {
users.git = {
description = "Gitea Service";
home = "/var/lib/gitea";
shell = "/bin/sh";
2023-08-24 23:34:48 +03:00
group = "gitea";
isSystemUser = true;
uid = myData.uidgid.gitea;
};
groups.gitea.gid = myData.uidgid.gitea;
};
services = {
gitea = {
enable = true;
user = "git";
database.user = "git";
settings = {
admin.DISABLE_REGULAR_ORG_CREATION = true;
api.ENABLE_SWAGGER = false;
mirror.ENABLED = false;
other.SHOW_FOOTER_VERSION = false;
packages.ENABLED = false;
repository = {
DEFAULT_REPO_UNITS = "repo.code,repo.releases";
DISABLE_MIGRATIONS = true;
DISABLE_STARS = true;
ENABLE_PUSH_CREATE_USER = true;
};
security.LOGIN_REMEMBER_DAYS = 30;
server = {
2024-01-17 10:11:13 +02:00
STATIC_URL_PREFIX = "/static";
2023-08-24 23:34:48 +03:00
ENABLE_GZIP = true;
LANDING_PAGE = "/motiejus";
ROOT_URL = "https://git.jakstys.lt";
HTTP_ADDR = "127.0.0.1";
2023-08-25 09:41:42 +03:00
HTTP_PORT = myData.ports.gitea;
2023-08-24 23:34:48 +03:00
DOMAIN = "git.jakstys.lt";
};
service = {
DISABLE_REGISTRATION = true;
ENABLE_TIMETRACKING = false;
ENABLE_USER_HEATMAP = false;
SHOW_MILESTONES_DASHBOARD_PAGE = false;
COOKIE_SECURE = true;
};
log.LEVEL = "Error";
2023-09-07 19:46:47 +03:00
mailer = {
ENABLED = true;
FROM = "<noreply@jakstys.lt>";
PROTOCOL = "smtp";
SMTP_ADDR = "localhost";
SMTP_PORT = 25;
};
2023-08-24 23:34:48 +03:00
"service.explore".DISABLE_USERS_PAGE = true;
};
};
openssh.extraConfig = ''
AcceptEnv GIT_PROTOCOL
'';
caddy = {
virtualHosts."git.jakstys.lt".extraConfig = ''
2024-01-17 10:11:13 +02:00
route /static/assets/* {
uri strip_prefix /static/assets
file_server * {
2024-02-13 21:01:38 +02:00
root ${pkgs.compressAll pkgs.gitea.data {}}/public
2024-01-17 10:11:13 +02:00
precompressed br gzip
}
}
2023-08-25 09:41:42 +03:00
reverse_proxy 127.0.0.1:${toString myData.ports.gitea}
2023-08-24 23:34:48 +03:00
'';
};
};
};
}