1
0
Fork 0
nixos/services/gitea.nix

44 lines
945 B
Nix
Raw Normal View History

{ config, lib, ... }:
2019-02-26 13:44:40 +01:00
with lib;
mkIf (elem "gitea" config.machine.services) {
services.gitea = let
cfg = config.machine;
domain = (findFirst (s: s.service == "gitea") cfg cfg.vHosts).domain;
in {
2019-02-26 13:44:40 +01:00
enable = true;
user = "git";
cookieSecure = true;
domain = domain;
rootUrl = "http://${domain}/";
2019-02-26 13:44:40 +01:00
database = {
type = "mysql";
user = "git";
name = "gitea";
passwordFile = "${cfg.secretPath}/gitea_db";
2019-02-26 13:44:40 +01:00
};
extraConfig = ''
[repository]
DISABLE_HTTP_GIT = false
2019-02-26 13:44:40 +01:00
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";
2019-02-26 13:44:40 +01:00
isNormalUser = true;
home = config.services.gitea.stateDir;
2019-02-26 13:44:40 +01:00
createHome = true;
useDefaultShell = true;
2019-02-26 13:44:40 +01:00
};
}