helm/modules/services/gitea.nix

36 lines
739 B
Nix
Raw Normal View History

{ options, config, lib, pkgs, ... }:
2020-03-28 22:48:43 -07:00
with lib;
with lib.my;
let cfg = config.modules.services.gitea;
in {
2020-03-28 22:48:43 -07:00
options.modules.services.gitea = {
enable = mkBoolOpt false;
2019-11-18 18:41:35 -08:00
};
2019-11-17 22:25:29 -08:00
config = mkIf cfg.enable {
2020-03-28 22:48:43 -07:00
# I prefer git@... ssh addresses over gitea@...
users.users.git = {
useDefaultShell = true;
home = "/var/lib/gitea";
group = "gitea";
};
services.gitea = {
enable = true;
2019-11-18 18:41:35 -08:00
user = "git";
database.user = "git";
2019-11-18 21:22:23 -08:00
2020-12-31 16:34:11 -08:00
disableRegistration = true;
2020-03-28 22:48:43 -07:00
# We're assuming SSL-only connectivity
cookieSecure = true;
2020-12-31 16:34:11 -08:00
# Only log what's important
log.level = "Error";
settings.server.DISABLE_ROUTER_LOG = true;
2020-03-28 22:48:43 -07:00
};
user.extraGroups = [ "gitea" ];
2019-11-18 18:41:35 -08:00
};
2019-11-17 22:25:29 -08:00
}