Home

dotnix @main - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
tree log patch
feat: dragonwell caddy Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmTyqnkACgkQuFOtpdp7 v3rfhw/9F+ju4MMroL8Z7VE9j7zQk7qjQzibPrtroyu3rkc+sqizhMAxLfp2Fzu4 uFriQfYXiM9P7/phXTx7PqVvA1FPFoEG+G2QHfBLN2f4C+dO1ppoFN19F7vFa6jG TYZ0KOiTJGYrvL3yzT8cdszIg+CX+nPt+jL8RC4nxzw/j8LCjZ6RFiRc6x8bEsOP OP53wjmWEzJ8bWKVrZBC2/CYK5bLc1rGippu5zye9wCpinwDNvIFrhm3T93wQT/5 owTxVajLA2lOhOdKXUS0qPFttW9fotTpp8CKHXrKEIWMajZ1aZfS7+i7Ts+xYDhh BPYy7zKlm34YS+Xdhr0vm0NZwzQW4m0wbsAD14zeWDcgJzs5kpdgSyxlkzN5CXg2 Rq44XeVFFHUT5QzzHzjsxBj7sX6X/4erENotoejQ0sJKEFEmFKDu1wciiRUK1wgq /KnoE5+ijAfu7NzzIi/Os+Jm5Fl2EWGogLuWGRf7HEPpFHtVOCHLUVQlgDWvxxGs TxNY2cKoy7e+fGntOGMoVXWE5AjOf65BTtaxVGiO6hT9TykHSGk+BF/kreht/ZqD iAGVCPia+uHrJYYPODg7hShcdzJiFnaW7/JNhodRvWZ9G9x/1dLypQYEpZdOg9yb bHUL71yJJPcya8Lzv/2FZBaIn87gaslYNsycAwoKy87NZOZyM7U= =cEkS -----END PGP SIGNATURE-----
jolheiser <john.olheiser@gmail.com>
1 year ago
2 changed files, 38 additions(+), 3 deletions(-)
I machines/dragonwell/caddy.nix
diff --git a/machines/dragonwell/caddy.nix b/machines/dragonwell/caddy.nix
new file mode 100644
index 0000000000000000000000000000000000000000..4353bb00780e0244c1a9550caa1067745e0d24e1
--- /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 / `<html><head><title>Go Packages</title></head><body><ul>${lib.strings.concatMapStrings (pkg: "<li><a href=\"${pkg}\">${pkg}</a></li>") packages}</ul></body></html>`
+          ''
+          + lib.strings.concatMapStrings (pkg: ''
+            respond /${pkg}* `<html><head>
+            <meta name="go-import" content="git.jojodev.com/jolheiser/${pkg} git https://git.jojodev.com/jolheiser/${pkg}.git">
+            <meta http-equiv="refresh" content="3; url=https://pkg.go.dev/go.jolheiser.com/${pkg}" />
+            </head><body>
+            Redirecting to <a href="https://pkg.go.dev/go.jolheiser.com/${pkg}">https://pkg.go.dev/go.jolheiser.com/${pkg}</a>
+            </body></html>`
+          '')
+          packages;
+      };
+    };
+  };
+}
M machines/dragonwell/default.nix -> machines/dragonwell/default.nix
diff --git a/machines/dragonwell/default.nix b/machines/dragonwell/default.nix
index c35fef6c1cbc43d44411ff1943b68602a1d11e0b..6d02f3a5a7a3f0f0ecc4f341cf1f69fb6b3ee8a6 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 @@
   networking = {
     hostName = "dragonwell";
 
-    firewall.enable = true;
+    firewall = {
+      enable = true;
+      allowedTCPPorts = [80 443];
+    };
   };
 
   services = {