summary refs log tree commit diff
path: root/mixins
diff options
context:
space:
mode:
Diffstat (limited to 'mixins')
-rw-r--r--mixins/syncthing.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/mixins/syncthing.nix b/mixins/syncthing.nix
new file mode 100644
index 0000000..3e219ae
--- /dev/null
+++ b/mixins/syncthing.nix
@@ -0,0 +1,38 @@
+{
+  pkgs,
+  config,
+  ...
+}: {
+  config = {
+    services.syncthing = {
+      enable = true;
+      user = "tzlil";
+      dataDir = "/home/tzlil/sync";
+      configDir = "/home/tzlil/.config/syncthing";
+      overrideDevices = true;
+      overrideFolders = true;
+      devices = {
+        "phone" = {id = "UHWVTEZ-BERNFCH-3ZXQHNE-ZRBHLU6-MBAVEHB-TKLQJM7-ZGHLJ4R-6E4SAA7";};
+      };
+      folders = {
+        "passwords" = {
+          path = "/home/tzlil/sync/passwords";
+          devices = ["phone"];
+        };
+      };
+    };
+
+    environment.persistence."/nix/persist".directories = [
+      {
+        directory = "/home/tzlil/sync";
+        user = "tzlil";
+        group = "users";
+      }
+      {
+        directory = "/home/tzlil/.config/syncthing";
+        user = "tzlil";
+        group = "users";
+      }
+    ];
+  };
+}