diff --git a/configs/nixos/modules/services/gitea.nix b/configs/nixos/modules/services/gitea.nix index 79b85dc..d69723c 100644 --- a/configs/nixos/modules/services/gitea.nix +++ b/configs/nixos/modules/services/gitea.nix @@ -11,7 +11,8 @@ in enable = lib.mkEnableOption "Gitea"; reverseProxyAddress = lib.mkOption { - type = lib.types.str; + type = lib.types.nullOr lib.types.str; + default = null; description = "IP address of the reverse proxy trusted to forward client headers."; }; }; @@ -55,6 +56,8 @@ in START_SSH_SERVER = true; SSH_LISTEN_HOST = "0.0.0.0"; SSH_LISTEN_PORT = 2222; + } + // lib.optionalAttrs (cfg.reverseProxyAddress != null) { REVERSE_PROXY_TRUSTED_PROXIES = "${cfg.reverseProxyAddress}/32"; }; service.DISABLE_REGISTRATION = true;