about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hosts/aptos/default.nix1
-rw-r--r--hosts/aptos/services.nix1
-rw-r--r--hosts/tahoe/services.nix1
-rw-r--r--modules/services/default.nix1
-rw-r--r--modules/services/syncthing/default.nix51
-rw-r--r--profiles/syncthing.nix44
6 files changed, 45 insertions, 54 deletions
diff --git a/hosts/aptos/default.nix b/hosts/aptos/default.nix
index 1a3e56f..6326615 100644
--- a/hosts/aptos/default.nix
+++ b/hosts/aptos/default.nix
@@ -8,6 +8,7 @@
     "${self}/profiles/btrfs.nix"
     "${self}/profiles/documentation.nix"
     "${self}/profiles/laptop.nix"
+    "${self}/profiles/syncthing.nix"
     "${self}/profiles/hardware/xps9300.nix"
   ];
 
diff --git a/hosts/aptos/services.nix b/hosts/aptos/services.nix
index 4e9e8ae..742b014 100644
--- a/hosts/aptos/services.nix
+++ b/hosts/aptos/services.nix
@@ -5,7 +5,6 @@ let
 in
 {
   my.services = {
-    syncthing.enable = true;
     backup = {
       enable = true;
       repository = "sftp:192.168.6.40:/aptos";
diff --git a/hosts/tahoe/services.nix b/hosts/tahoe/services.nix
index d49785b..058d31c 100644
--- a/hosts/tahoe/services.nix
+++ b/hosts/tahoe/services.nix
@@ -23,7 +23,6 @@ in
       promtail.enable = true;
       node-exporter.enable = true;
     };
-    syncthing.enable = true;
     backup = {
       enable = true;
       repository = "/data/slow/backups/hosts/tahoe";
diff --git a/modules/services/default.nix b/modules/services/default.nix
index 531ce7b..77cf853 100644
--- a/modules/services/default.nix
+++ b/modules/services/default.nix
@@ -5,6 +5,5 @@
     ./backup
     ./monitoring
     ./sendsms
-    ./syncthing
   ];
 }
diff --git a/modules/services/syncthing/default.nix b/modules/services/syncthing/default.nix
deleted file mode 100644
index 7f795bf..0000000
--- a/modules/services/syncthing/default.nix
+++ /dev/null
@@ -1,51 +0,0 @@
-{ config, pkgs, lib, ... }:
-let
-  cfg = config.my.services.syncthing;
-  secrets = config.age.secrets;
-in
-{
-  options.my.services.syncthing = with lib; {
-    enable = mkEnableOption "syncthing service";
-  };
-
-  config = lib.mkIf cfg.enable {
-    services.syncthing = {
-      enable = true;
-      openDefaultPorts = true;
-      user = "fcuny";
-      group = "users";
-      dataDir = "/home/fcuny/.local/state/syncthing";
-      cert = secrets."syncthing/cert".path;
-      key = secrets."syncthing/key".path;
-
-      folders.Documents = {
-        path = "/home/fcuny/documents";
-        devices = [ "aptos" "tahoe" ];
-      };
-
-      folders.PixelCamera = {
-        path = "/home/fcuny/media/pixel/camera";
-        id = "pixel_5_vwsr-photos";
-        devices = lib.attrNames config.services.syncthing.devices;
-      };
-
-      devices = {
-        aptos = {
-          id =
-            "JAN5UMH-2FAQQ7S-KLQ2YXM-C7KKK7U-HVHUK7I-CWOZQRM-VLQSO63-ZTP4WAN";
-          introducer = false;
-        };
-        tahoe = {
-          id =
-            "4Y36C3Y-LUTO6LD-JXNV73B-FLXSTNP-5Q3CSPY-HESHTPH-EDYA54K-WEICJAJ";
-          introducer = true;
-        };
-        pixel = {
-          id =
-            "J3JQFCJ-MY5RCF7-4NXMVU5-2JECKWO-UHFUS5T-KO64EMB-RNUV4F2-ZQ7Z6A6";
-          introducer = false;
-        };
-      };
-    };
-  };
-}
diff --git a/profiles/syncthing.nix b/profiles/syncthing.nix
new file mode 100644
index 0000000..6dcb503
--- /dev/null
+++ b/profiles/syncthing.nix
@@ -0,0 +1,44 @@
+{ config, pkgs, lib, ... }:
+let
+  secrets = config.age.secrets;
+in
+{
+  services.syncthing = {
+    enable = true;
+    openDefaultPorts = true;
+    user = "fcuny";
+    group = "users";
+    dataDir = "/home/fcuny/.local/state/syncthing";
+    cert = secrets."syncthing/cert".path;
+    key = secrets."syncthing/key".path;
+
+    folders.Documents = {
+      path = "/home/fcuny/documents";
+      devices = [ "aptos" "tahoe" ];
+    };
+
+    folders.PixelCamera = {
+      path = "/home/fcuny/media/pixel/camera";
+      id = "pixel_5_vwsr-photos";
+      devices = lib.attrNames config.services.syncthing.devices;
+    };
+
+    devices = {
+      aptos = {
+        id =
+          "JAN5UMH-2FAQQ7S-KLQ2YXM-C7KKK7U-HVHUK7I-CWOZQRM-VLQSO63-ZTP4WAN";
+        introducer = false;
+      };
+      tahoe = {
+        id =
+          "4Y36C3Y-LUTO6LD-JXNV73B-FLXSTNP-5Q3CSPY-HESHTPH-EDYA54K-WEICJAJ";
+        introducer = true;
+      };
+      pixel = {
+        id =
+          "J3JQFCJ-MY5RCF7-4NXMVU5-2JECKWO-UHFUS5T-KO64EMB-RNUV4F2-ZQ7Z6A6";
+        introducer = false;
+      };
+    };
+  };
+}