From e1e33ec6e9054da1fae93bdc3a7a0fc7372242a9 Mon Sep 17 00:00:00 2001 From: coolneng Date: Tue, 25 Feb 2020 14:03:24 +0100 Subject: [PATCH] Refactor Syncthing folder declaration --- modules/datasync.nix | 49 +++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/modules/datasync.nix b/modules/datasync.nix index 3e78852..1714028 100644 --- a/modules/datasync.nix +++ b/modules/datasync.nix @@ -16,27 +16,44 @@ declarative = { devices = { monolith = { id = "64P2YDH-S5V7PKM-XXBOSXC-WEXUSC7-B553ELI-6IJ3CPJ-ZFB3YA5-MTKAFAH"; }; - roamer = { id = "SFUXNH2-BMGSNOY-WKIGEGY-B2IELHN-DEZGSXW-LRTQOIX-LV5QIMV-2MTPGAU"; }; + roamer = { id = "7CDUG25-KGBOIA7-Y73TZGA-NEHYLZP-OEOEWVN-DMS5U7K-QNNMPKY-YNGEWQL"; }; unit = { id = "VYHHL4A-KJ6WUYQ-4SNWNA3-YRCFTHE-52ZTRLP-4LV6ZDV-4VAJLHC-RJXYYQY"; }; }; folders = { - "Documents" = { devices = [ "monolith" "roamer" "unit" ]; id = "wusdj-bfjkr"; }; - "Notes" = { devices = [ "monolith" "roamer" "unit" ]; id = "kafhz-bfmzm"; }; - "Music" = { devices = [ "monolith" "roamer" "unit" ]; id = "2aqt7-vpprc"; }; - "Photos" = { devices = [ "monolith" "roamer" "unit" ]; id = "mjibc-ustcg"; }; - "Projects" = { devices = [ "monolith" "unit" ]; id = "cjhmu-avy9v"; }; + Documents = { + id = "wusdj-bfjkr"; + type = "receiveonly"; + path = "/vault/syncthing/Documents"; + devices = [ "monolith" "roamer" "unit" ]; + }; - Documents.type = "receiveonly"; - Notes.type = "receiveonly"; - Music.type = "receiveonly"; - Photos.type = "receiveonly"; - Projects.type = "receiveonly"; + Notes = { + id = "kafhz-bfmzm"; + type = "receiveonly"; + path = "/vault/syncthing/Notes"; + devices = [ "monolith" "roamer" "unit" ]; + }; - Documents.path = "/vault/syncthing/Documents"; - Notes.path = "/vault/syncthing/Notes"; - Music.path = "/vault/syncthing/Music"; - Photos.path = "/vault/syncthing/Photos"; - Projects.path = "/vault/syncthing/Projects"; + Music = { + id = "2aqt7-vpprc"; + type = "receiveonly"; + path = "/vault/syncthing/Music"; + devices = [ "monolith" "roamer" "unit" ]; + }; + + Photos = { + id = "mjibc-ustcg"; + type = "receiveonly"; + path = "/vault/syncthing/Photos"; + devices = [ "monolith" "roamer" "unit" ]; + }; + + Projects = { + devices = [ "monolith" "unit" ]; + id = "cjhmu-avy9v"; + type = "receiveonly"; + path = "/vault/syncthing/Projects"; + }; }; }; };