From ea75d13a23afe5cec83e3348f92a8654324957e5 Mon Sep 17 00:00:00 2001 From: Devin Finlinson Date: Sun, 9 Feb 2025 17:38:14 -0700 Subject: adding caddy reverse proxy for cgit --- modules/nixos/cgit.nix | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'modules') diff --git a/modules/nixos/cgit.nix b/modules/nixos/cgit.nix index c4ef76a..f1d4d55 100644 --- a/modules/nixos/cgit.nix +++ b/modules/nixos/cgit.nix @@ -1,10 +1,13 @@ -{ config, pkgs, ... } : { # This is for hosting on bosco +{ config, pkgs, ... } : +let + domain = "myrmexia.xyz"; + subDomain = "git.${domain}"; + email = "devin.finlinson@pm.me"; +in { # This is for hosting on bosco services.cgit = { - "git.myrmexia.xyz" = { + "${subDomain}" = { user = "cgit"; enable = true; - nginx.location = "/"; - # nginx.virtualHost = "git.myrmexia.xyz"; settings = { enable-commit-graph = 1; enable-http-clone = 0; @@ -25,11 +28,12 @@ # this solution is extremely hacky as it changes nginx system defaults instead of virtual host default #TODO: fix services.nginx.defaultHTTPListenPort = 8081; - # caddy = { - # enable = true; - # email = "devin.finlinson@pm.me"; - # virtualhosts."git.myrmexia.xyz".extraConfig = '' - # reverse_proxy http://localhost:${toString config.services.cgit.port} '' - # }; + caddy = { + enable = true; + email = "${email}"; + virtualhosts."git.myrmexia.xyz".extraConfig = '' + "reverse_proxy http://localhostt:8081" ''; + # reverse_proxy http://localhost:${toString config.services.cgit.port} '' + }; networking.firewall.allowedTCPPorts = [8081]; } -- cgit v1.2.3