diff --git a/machines/dragonwell/caddy.nix b/machines/dragonwell/caddy.nix
new file mode 100644
index 0000000..4353bb0
--- /dev/null
+++ b/machines/dragonwell/caddy.nix
@@ -0,0 +1,32 @@
+{lib, ...}: let
+ packages = ["tmpl" "git-age" "ffmd"];
+in {
+ services.caddy = {
+ enable = true;
+ virtualHosts = {
+ "jolheiser.com" = {
+ extraConfig = ''
+ root * /srv/jolheiser.com/dist
+ file_server
+ '';
+ serverAliases = ["www.jolheiser.com"];
+ };
+ "go.jolheiser.com" = {
+ extraConfig =
+ ''
+ header Content-Type text/html
+ respond / `
Go Packages${lib.strings.concatMapStrings (pkg: "- ${pkg}
") packages}
`
+ ''
+ + lib.strings.concatMapStrings (pkg: ''
+ respond /${pkg}* `
+
+
+
+ Redirecting to https://pkg.go.dev/go.jolheiser.com/${pkg}
+ `
+ '')
+ packages;
+ };
+ };
+ };
+}
diff --git a/machines/dragonwell/default.nix b/machines/dragonwell/default.nix
index c35fef6..6d02f3a 100644
--- a/machines/dragonwell/default.nix
+++ b/machines/dragonwell/default.nix
@@ -1,7 +1,7 @@
-{pkgs, ...}: let
+let
username = "jolheiser";
in {
- imports = [./hardware.nix ../common/nogui];
+ imports = [./caddy.nix ./hardware.nix ../common/nogui];
boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
@@ -9,7 +9,10 @@ in {
networking = {
hostName = "dragonwell";
- firewall.enable = true;
+ firewall = {
+ enable = true;
+ allowedTCPPorts = [80 443];
+ };
};
services = {