From d1ef7bc3eaed105ebb9177f3bdb816ec3f1bd2a2 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Wed, 8 May 2024 16:02:53 -0400 Subject: [PATCH] fix(forgejo): use domain instead of full url --- modules/services/forgejo/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/services/forgejo/default.nix b/modules/services/forgejo/default.nix index 39cccb4..5bf7892 100644 --- a/modules/services/forgejo/default.nix +++ b/modules/services/forgejo/default.nix @@ -6,7 +6,8 @@ with lib; let cfg = config.my.services.forgejo; inherit (config.my.server) domain proxyIP firewallInterface; - url = "https://git.${domain}"; + forgejoDomain = "git.${domain}"; + forgejoUrl = "https://${forgejoDomain}"; in { options.my.services.forgejo = { enable = mkEnableOption "Forgejo"; @@ -30,8 +31,8 @@ in { services.forgejo = { enable = true; settings.server = { - DOMAIN = "git.${domain}"; - ROOT_URL = url; + DOMAIN = forgejoDomain; + ROOT_URL = forgejoUrl; DISABLE_SSH = true; HTTP_PORT = cfg.port; }; @@ -64,7 +65,7 @@ in { ]; }) (mkIf cfg.proxy { - services.caddy.virtualHosts."${url}".extraConfig = '' + services.caddy.virtualHosts."${forgejoDomain}".extraConfig = '' reverse_proxy http://${proxyIP}:${toString cfg.port} ''; })