Fix matrix and caddy not restarting on config file updates
diff --git a/README.md b/README.md
index 68677ed..91abef7 100644
--- a/README.md
+++ b/README.md
@@ -16,3 +16,18 @@
 ```sh
 deploy
 ```
+
+## Updating secrets
+
+Secrets are stored in SOPS and deployed using scalpel.
+
+If you have a service which needs to store secrets in its config file, please
+set systemd reloadTriggers and restartTriggers to automatically reload/restart
+the service whenever the configuration changes.
+
+It's notable that changing the secrets _will not_ trigger a reload/restart of
+the service. If you want to update the secrets without updating the rest of the
+configuration you currently need to manually restart the service. It's possible
+that this could be solved by using systemd paths to watch the files (see
+<https://superuser.com/questions/1171751/restart-systemd-service-automatically-whenever-a-directory-changes-any-file-ins>)
+but this is not a priority
diff --git a/flake.nix b/flake.nix
index 2dafc74..c43c3e1 100644
--- a/flake.nix
+++ b/flake.nix
@@ -29,7 +29,7 @@
         config.allowUnfree = true;
       };
     in
-    {
+    rec {
       nixosConfigurations.clicks =
         let
           base = nixpkgs.lib.nixosSystem {
@@ -75,6 +75,13 @@
           specialArgs = { inherit base; };
         };
 
+      nixosConfigurations.clicks-without-mongodb =
+        nixosConfigurations.clicks.extendModules {
+          modules = [
+            { services.mongodb.enable = nixpkgs.lib.mkForce false; }
+          ];
+        };
+
       deploy.nodes.clicks = {
         sudo = "doas -u";
         profiles = {
diff --git a/modules/caddy.nix b/modules/caddy.nix
index 51efde5..a76672e 100644
--- a/modules/caddy.nix
+++ b/modules/caddy.nix
@@ -37,6 +37,8 @@
       };
 
       services.caddy.configFile = lib.mkForce config.scalpel.trafos."caddy.json".destination;
+
+      systemd.services.caddy.reloadTriggers = [ caddy_json ];
     }
   else { }
 )
diff --git a/modules/matrix.nix b/modules/matrix.nix
index 4be396e..81cc257 100644
--- a/modules/matrix.nix
+++ b/modules/matrix.nix
@@ -82,6 +82,8 @@
           "${base.config.systemd.services.matrix-synapse.preStart}"
       );
 
+      systemd.services.matrix-synapse.restartTriggers = [ synapse_cfgfile ];
+
       environment.systemPackages =
         with lib; let
           cfg = config.services.matrix-synapse;