summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--modules/satoshipay.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix
index 46cccc75..5198cc14 100644
--- a/modules/satoshipay.nix
+++ b/modules/satoshipay.nix
@@ -46,6 +46,17 @@
       OnActiveSec = "1 min";
     };
   };
+  systemd.services.mongodb-init = {
+    description = "Init mongodb replicaset";
+    requires = [ "mongodb.service" ];
+    script = "${pkgs.mongodb}/bin/mongo --eval 'rs.initiate()'";
+  };
+  systemd.timers.mongodb-init = {
+    wantedBy = [ "timers.target" ];
+    timerConfig = {
+      OnActiveSec = "2 min";
+    };
+  };
 
   services.redis = {
     enable = true;