From 4c9de84663eb979351993ef07446f86b891cc4f0 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Mon, 1 Jul 2024 15:00:37 -0500 Subject: [PATCH] feat(dragonwell): allow for nonstandard modules from past forges in caddy Signed-off-by: jolheiser --- machines/dragonwell/caddy.nix | 5 ++++- machines/dragonwell/go.nix | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 machines/dragonwell/go.nix diff --git a/machines/dragonwell/caddy.nix b/machines/dragonwell/caddy.nix index c6f1dd8..768c75d 100644 --- a/machines/dragonwell/caddy.nix +++ b/machines/dragonwell/caddy.nix @@ -1,4 +1,6 @@ -{pkgs, ...}: { +{pkgs, ...}: let + modules = import ./go.nix; +in { services.caddy = { enable = true; virtualHosts = { @@ -35,6 +37,7 @@ "go.jolheiser.com" = { extraConfig = '' header Content-Type text/html + ${modules} respond /* ` diff --git a/machines/dragonwell/go.nix b/machines/dragonwell/go.nix new file mode 100644 index 0000000..6976212 --- /dev/null +++ b/machines/dragonwell/go.nix @@ -0,0 +1,21 @@ +let + modules = [ + { + name = "hcaptcha"; + repo = "gitea.com/jolheiser/hcaptcha"; + } + { + name = "pwn"; + repo = "gitea.com/jolheiser/pwn"; + } + ]; +in + builtins.concatStringsSep "\n" (builtins.map (module: '' + respond /${module.name}* ` + + + + Redirecting to https://pkg.go.dev/go.jolheiser.com/${module.name} + ` + '') + modules)