diff --git a/modules/services/default.nix b/modules/services/default.nix index a272e88..2b35214 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -10,6 +10,7 @@ ./ente.nix ./fileshelter.nix ./games + ./gitea.nix ./github-runner.nix ./gitolite.nix ./kavita.nix diff --git a/modules/services/gitea.nix b/modules/services/gitea.nix new file mode 100644 index 0000000..1488c46 --- /dev/null +++ b/modules/services/gitea.nix @@ -0,0 +1,41 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: +let + cfg = config.custom.services.gitea; +in +{ + options.custom.services.gitea = { + enable = lib.mkEnableOption "Enables gitea"; + fqdn = lib.mkOption { + type = lib.types.str; + default = "git.kopatz.dev"; + description = "FQDN under which gitea is available"; + }; + }; + config = lib.mkIf cfg.enable { + # Initial setup requires + services.gitea = { + enable = true; + stateDir = "/1tbssd/gitea"; + settings = { + server.HTTP_PORT = 3001; + service.DISABLE_REGISTRATION = true; + server.DOMAIN = cfg.fqdn; + server.ROOT_URL = "https://${cfg.fqdn}"; + server.DISABLE_SSH = true; + }; + }; + services.nginx.virtualHosts."${cfg.fqdn}" = { + forceSSL = true; + enableACME = true; + quic = true; + http3 = true; + locations."/".proxyPass = "http://localhost:3001"; + }; + }; +} diff --git a/systems/amd-server-vm/configuration.nix b/systems/amd-server-vm/configuration.nix index b8a2261..a1b907e 100644 --- a/systems/amd-server-vm/configuration.nix +++ b/systems/amd-server-vm/configuration.nix @@ -105,6 +105,7 @@ services = { acme.enable = true; gitolite.enable = true; + gitea.enable = true; github-runner.enable = true; caldav.enable = true; kop-monitor.enable = true; diff --git a/systems/pc/configuration.nix b/systems/pc/configuration.nix index 2293bf1..60ebbee 100644 --- a/systems/pc/configuration.nix +++ b/systems/pc/configuration.nix @@ -120,6 +120,7 @@ }; }; + services.trilium-server.enable = false; # maybe consider in the future services.nohang.enable = true; services.logind.settings.Login = {