2024-11-26 08:40:00 +00:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
2024-12-10 21:40:33 +00:00
|
|
|
with lib;
|
|
|
|
|
2024-12-15 23:13:11 +00:00
|
|
|
let
|
|
|
|
port = 2222;
|
|
|
|
in
|
2024-11-26 08:40:00 +00:00
|
|
|
{
|
2024-12-10 21:40:33 +00:00
|
|
|
options.features.homelab.gitea.enable = mkEnableOption "Enable gitea";
|
2024-11-26 08:40:00 +00:00
|
|
|
|
2024-12-10 21:40:33 +00:00
|
|
|
config = mkIf config.features.homelab.gitea.enable {
|
2024-12-15 23:13:11 +00:00
|
|
|
services = {
|
|
|
|
gitea = {
|
|
|
|
enable = true;
|
|
|
|
group = "media";
|
|
|
|
stateDir = "/mnt/media/gitea";
|
2024-11-26 08:40:00 +00:00
|
|
|
|
2024-12-15 23:13:11 +00:00
|
|
|
settings = {
|
|
|
|
server = {
|
|
|
|
HTTP_PORT = port;
|
|
|
|
};
|
2024-11-26 08:40:00 +00:00
|
|
|
|
2024-12-15 23:13:11 +00:00
|
|
|
service = {
|
|
|
|
DISABLE_REGISTRATION = true;
|
|
|
|
};
|
2024-11-26 08:40:00 +00:00
|
|
|
};
|
|
|
|
};
|
2024-12-15 23:13:11 +00:00
|
|
|
|
2025-01-01 14:45:03 +00:00
|
|
|
caddy.virtualHosts."gitea.opdavies.uk" = {
|
|
|
|
useACMEHost = "opdavies.uk";
|
2024-12-15 23:13:11 +00:00
|
|
|
|
2025-01-01 14:45:03 +00:00
|
|
|
extraConfig = "reverse_proxy localhost:${toString port}";
|
2024-12-15 23:13:11 +00:00
|
|
|
};
|
2024-11-26 08:40:00 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|