gitea: add new service

This commit is contained in:
Felix Buehler 2022-11-09 22:20:11 +01:00
parent 5c88d557d5
commit e28e66e5f5

View file

@ -0,0 +1,55 @@
# self-hosted git service
{ config, lib, ... }:
let
cfg = config.my.services.gitea;
domain = config.networking.domain;
in
{
options.my.services.gitea = with lib; {
enable = mkEnableOption "Gitea";
port = mkOption {
type = types.port;
default = 3042;
example = 8080;
description = "Internal port";
};
};
config = lib.mkIf cfg.enable {
services.gitea = {
enable = true;
httpPort = cfg.port;
log.level = "Warn";
disableRegistration = true;
cookieSecure = true;
settings = {
ui.DEFAULT_THEME = "arc-green";
};
lfs.enable = true;
};
# Proxy to Gitea
my.services.nginx.virtualHosts = [
{
subdomain = "git";
inherit (cfg) port;
}
];
#my.services.backup = {
# paths = [
# config.services.gitea.lfs.contentDir
# config.services.gitea.repositoryRoot
# ];
#};
webapps.apps.gitea = {
dashboard = {
name = "Git";
category = "app";
icon = "git";
link = "https://git.${domain}";
};
};
};
}