40 lines
869 B
Nix
40 lines
869 B
Nix
{ config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
mkIf (elem "gitea" config.machine.services) {
|
|
services.gitea = {
|
|
enable = true;
|
|
user = "git";
|
|
cookieSecure = true;
|
|
domain = "git.${config.machine.domain}";
|
|
rootUrl = "http://git.${config.machine.domain}/";
|
|
database = {
|
|
type = "mysql";
|
|
user = "git";
|
|
name = "gitea";
|
|
passwordFile = "/secret/gitea_db";
|
|
};
|
|
extraConfig = ''
|
|
[repository]
|
|
DISABLE_HTTP_GIT = false
|
|
USE_COMPAT_SSH_URI = true
|
|
|
|
[security]
|
|
INSTALL_LOCK = true
|
|
COOKIE_USERNAME = gitea_username
|
|
COOKIE_REMEMBER_NAME = gitea_userauth
|
|
|
|
[service]
|
|
DISABLE_REGISTRATION = true
|
|
'';
|
|
};
|
|
|
|
users.users.git = {
|
|
description = "Gitea Service";
|
|
isNormalUser = true;
|
|
home = config.services.gitea.stateDir;
|
|
createHome = true;
|
|
useDefaultShell = true;
|
|
};
|
|
}
|