Commit 092569e

HPCesia <me@hpcesia.com>
2025-10-01 15:44:16
refactor: migrate caddy basic config
1 parent 8e14b45
Changed files (3)
hosts
chaser-pardofelis
modules
hosts
chaser-pardofelis
services
hosts/chaser-pardofelis/caddy.nix
@@ -12,16 +12,6 @@
   });
 in {
   services.caddy = {
-    enable = true;
-    # Reload Caddy instead of restarting it when configuration file changes.
-    enableReload = true;
-
-    globalConfig = ''
-      http_port   80
-      https_port  443
-      email ${myvars.useremail}
-    '';
-
     virtualHosts = let
       localAddress = {
         artalk = "http://localhost:${builtins.toString config.services.artalk.settings.port}";
@@ -108,6 +98,4 @@ in {
       '';
     };
   };
-
-  networking.firewall.allowedTCPPorts = [80 443];
 }
modules/hosts/chaser-pardofelis/default.nix
@@ -13,6 +13,7 @@
         map
         (n: config.flake.modules.nixos."${config.flake.meta.service.prefix}${n}")
         [
+          "caddy"
         ]
       );
   };
modules/services/caddy.nix
@@ -0,0 +1,16 @@
+{
+  flake.modules.nixos."services/caddy" = _: {
+    services.caddy = {
+      enable = true;
+      # Reload Caddy instead of restarting it when configuration file changes.
+      enableReload = true;
+
+      globalConfig = ''
+        http_port   80
+        https_port  443
+      '';
+    };
+
+    networking.firewall.allowedTCPPorts = [80 443];
+  };
+}