From e74269d9cf51036647d7f726769d803064de9c37 Mon Sep 17 00:00:00 2001 From: coolneng Date: Fri, 8 Nov 2019 01:05:42 +0100 Subject: [PATCH] Add declarative folders and devices in Syncthing --- Timeline.org | 4 ++-- modules/datasync.nix | 24 +++++++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Timeline.org b/Timeline.org index 7baedb0..4e2d139 100644 --- a/Timeline.org +++ b/Timeline.org @@ -30,8 +30,8 @@ *** TODO Wireguard [0/1] [0%] - [ ] Encrypted DNS ** Data sync [0/2] [0%] -*** IN-PROGRESS Syncthing [0/3] [0%] - - [ ] Basic configuration +*** IN-PROGRESS Syncthing [1/3] [33%] + - [X] Basic configuration - [ ] Relay server - [ ] Discovery server *** TODO Radicale diff --git a/modules/datasync.nix b/modules/datasync.nix index 7d977a4..967bbda 100644 --- a/modules/datasync.nix +++ b/modules/datasync.nix @@ -1,4 +1,4 @@ -# Syncthing and Radicale configuration +# syncthingthing and Radicale configuration { config, pkgs, lib, ... }: { @@ -9,7 +9,7 @@ radicale ]; - # Enable Syncthing + # Enable syncthingthing services.syncthing = { enable = true; openDefaultPorts = true; @@ -18,10 +18,28 @@ declarative = { devices = { monolith = { id = "QGDGEZQ-INE7XDY-DNX2QI4-QI7ANQJ-57REEO2-FUMH545-FZS5RYU-ULF7HA2"; }; + roamer = { id = "DS3PJH3-J6SNMHM-XUJTDLO-DHGJL5U-J3RUMAG-4OSJWIK-VSJSDVJ-PIHZ2QP"; }; }; #cert = ""; #key = ""; - folders = {}; + folders = { + "Documents" = { devices = [ "monolith" ]; id = "wusdj-bfjkr"; }; + "Notes" = { devices = [ "monolith" "roamer" ]; id = "2aqt7-vpprc"; }; + "Music" = { devices = [ "monolith" ]; id = "kafhz-bfmzm"; }; + "Photos" = { devices = [ "monolith" "roamer" ]; id = "mjibc-ustcg"; }; + "Security" = { devices = [ "monolith" ]; id = "z4lpn-pmm3v"; }; + "Projects" = { devices = [ "monolith" ]; id = "cjhmu-avy9v"; }; + + Documents.type = "receiveonly"; + Projects.type = "receiveonly"; + + Documents.path = "/vault/syncthing/Documents"; + Notes.path = "/vault/syncthing/Notes"; + Music.path = "/vault/syncthing/Music"; + Photos.path = "/vault/syncthing/Photos"; + Security.path = "/vault/syncthing/Security"; + Projects.path = "/vault/syncthing/Projects"; + }; }; #relay = { #enable = true;