From d01c8a8cc33da7436409d95c4e9a4a4bf1f3a2db Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 27 Jun 2023 09:54:15 +0100 Subject: [PATCH] Clean up syncthing config, add N0245 config --- services/syncthing/Legion.nix | 16 +----- services/syncthing/N0245.nix | 29 ++++------- services/syncthing/Vanguard.nix | 13 +++-- services/syncthing/default.nix | 62 ++++++++++++++++++++--- services/syncthing/devices/H0615.nix | 1 - services/syncthing/devices/Ion.nix | 1 - services/syncthing/devices/J0162.nix | 1 - services/syncthing/devices/Legion.nix | 1 - services/syncthing/devices/Monarch.nix | 1 - services/syncthing/devices/Northstar.nix | 1 - services/syncthing/devices/Remarkable.nix | 1 - services/syncthing/devices/Vanguard.nix | 1 - services/syncthing/devices/default.nix | 10 ---- services/syncthing/folders/archive.nix | 11 ---- services/syncthing/folders/books.nix | 17 ------- services/syncthing/folders/camera.nix | 12 ----- services/syncthing/folders/comics.nix | 17 ------- services/syncthing/folders/documents.nix | 16 ------ services/syncthing/folders/exports.nix | 11 ---- services/syncthing/folders/movies.nix | 11 ---- services/syncthing/folders/notes.nix | 17 ------- services/syncthing/folders/pictures.nix | 17 ------- services/syncthing/folders/xochitl.nix | 12 ----- services/syncthing/folders/zotero.nix | 11 ---- 24 files changed, 74 insertions(+), 216 deletions(-) delete mode 100644 services/syncthing/devices/H0615.nix delete mode 100644 services/syncthing/devices/Ion.nix delete mode 100644 services/syncthing/devices/J0162.nix delete mode 100644 services/syncthing/devices/Legion.nix delete mode 100644 services/syncthing/devices/Monarch.nix delete mode 100644 services/syncthing/devices/Northstar.nix delete mode 100644 services/syncthing/devices/Remarkable.nix delete mode 100644 services/syncthing/devices/Vanguard.nix delete mode 100644 services/syncthing/devices/default.nix delete mode 100644 services/syncthing/folders/archive.nix delete mode 100644 services/syncthing/folders/books.nix delete mode 100644 services/syncthing/folders/camera.nix delete mode 100644 services/syncthing/folders/comics.nix delete mode 100644 services/syncthing/folders/documents.nix delete mode 100644 services/syncthing/folders/exports.nix delete mode 100644 services/syncthing/folders/movies.nix delete mode 100644 services/syncthing/folders/notes.nix delete mode 100644 services/syncthing/folders/pictures.nix delete mode 100644 services/syncthing/folders/xochitl.nix delete mode 100644 services/syncthing/folders/zotero.nix diff --git a/services/syncthing/Legion.nix b/services/syncthing/Legion.nix index 92526a24..ac88d162 100644 --- a/services/syncthing/Legion.nix +++ b/services/syncthing/Legion.nix @@ -1,21 +1,7 @@ {...}: { - imports = [ - ./default.nix - ./folders/archive.nix - ./folders/books.nix - ./folders/camera.nix - ./folders/comics.nix - ./folders/documents.nix - ./folders/exports.nix - ./folders/movies.nix - ./folders/notes.nix - ./folders/pictures.nix - ./folders/xochitl.nix - ./folders/zotero.nix - ]; + imports = [./default.nix]; services.syncthing = { user = "xenia"; group = "users"; - extraOptions.options.globalAnnounceEnabled = true; }; } diff --git a/services/syncthing/N0245.nix b/services/syncthing/N0245.nix index 19247d1e..01373c4a 100644 --- a/services/syncthing/N0245.nix +++ b/services/syncthing/N0245.nix @@ -1,26 +1,19 @@ {...}: { - imports = [ - ./default.nix - ./devices/Ion.nix - ./devices/Legion.nix - ./devices/Monarch.nix - ./devices/Northstar.nix - ./devices/Vanguard.nix - ./folders/notes.nix - ./folders/zotero.nix - ]; + imports = [./default.nix]; services.syncthing = { user = "elitherl"; group = "users"; dataDir = "/home/elitherl"; - extraOptions.options.globalAnnounceEnabled = true; - folders."Notes" = { - path = "~/notes"; - devices = ["ion" "legion" "monarch" "northstar" "vanguard"]; - }; - folders."Zotero" = { - path = "~/Documents/Zotero"; - devices = ["ion" "legion"]; + folders = { + "Archive".enable = false; + "Books".enable = false; + "Comics".enable = false; + "Documents".enable = false; + "Exports".enable = false; + "Notes".path = "~/notes"; + "Pictures".enable = false; + "Xochitl".enable = false; + "Zotero".path = "~/Documents/Zotero"; }; }; } diff --git a/services/syncthing/Vanguard.nix b/services/syncthing/Vanguard.nix index 03ec0dc5..d12e31d2 100644 --- a/services/syncthing/Vanguard.nix +++ b/services/syncthing/Vanguard.nix @@ -1,19 +1,18 @@ {...}: { - imports = [ - ./default.nix - ./folders/comics.nix - ./folders/notes.nix - ./folders/pictures.nix - ]; + imports = [./default.nix]; services.syncthing = { user = "xenia"; group = "users"; dataDir = "/home/xenia"; - extraOptions.options.globalAnnounceEnabled = true; folders = { + "Archive".path = "~/Documents/Archive"; + "Books".path = "~/Documents/Books"; "Comics".path = "~/Documents/Comics"; + "Documents".path = "~/Documents/Sync"; + "Exports".path = "~/Documents/Exports"; "Notes".path = "~/notes"; "Pictures".path = "~/Pictures"; + "Zotero".path = "~/Documents/Zotero"; }; }; } diff --git a/services/syncthing/default.nix b/services/syncthing/default.nix index 4e08a54d..6f8aef8f 100644 --- a/services/syncthing/default.nix +++ b/services/syncthing/default.nix @@ -1,13 +1,63 @@ -{lib, ...}: { - imports = [./devices]; +{...}: { services.syncthing = { enable = true; systemService = true; openDefaultPorts = true; - extraOptions = { - options = { - globalAnnounceEnabled = lib.mkDefault false; - localAnnounceEnabled = lib.mkDefault true; + devices = { + "ion".id = "7DD4NPH-6T2ET5A-4FCLFWW-CS6UR2W-IO5XQXC-DM5B2Q4-6X7DGU2-UKKVEAB"; + "legion".id = "6OX54CG-EAQMXKA-K7TXB5P-G5A27HB-52JE2FA-XNAYZU6-YMIDBXP-RKPBJQV"; + "monarch".id = "CJSUZQY-67XBLEZ-VKVHQHI-BLEUZNF-G4237AV-AW44CGH-F3JDKXU-CWT3RQZ"; + "northstar".id = "W3QZTFS-BB42JYB-NQBZ5IM-H3WLAUQ-M57I2CP-FALWGEX-JI2ZZOC-QWAX2QQ"; + "remarkable".id = "GHB6JKS-JOA3HHP-TYHB3IJ-GLV26QW-RWRZAMG-XYFGFB6-QLUHDSH-GNPZVAO"; + "vanguard".id = "I366QNQ-D3FTDRX-RNOTXMW-YITZXOF-DSCDMQD-63Q72LI-ME2Y4HZ-T34RMQK"; + "N0245".id = "ZOL5YHK-ZZZULIE-UHGVKHW-H5E4BP7-S4CZBOX-OIZVUCV-RZUXOKA-QVBUBAJ"; + }; + folders = { + "Archive" = { + id = "hwnqy-xzcdx"; + ignorePerms = true; + devices = ["legion" "monarch" "vanguard"]; + }; + "Books" = { + id = "zjmxy-ycmbq"; + ignorePerms = true; + devices = ["legion" "monarch" "northstar" "remarkable" "vanguard"]; + }; + "Comics" = { + id = "kc2h0-q3wot"; + ignorePerms = true; + devices = ["ion" "legion" "monarch" "northstar" "vanguard"]; + }; + "Documents" = { + id = "qc6qa-bipsd"; + ignorePerms = true; + devices = ["legion" "monarch" "northstar" "vanguard"]; + }; + "Exports" = { + id = "tof2e-pdtde"; + ignorePerms = true; + devices = ["legion" "monarch" "vanguard"]; + }; + "Notes" = { + id = "4ggjz-5dyop"; + ignorePerms = true; + devices = ["ion" "legion" "monarch" "northstar" "vanguard" "N0245"]; + }; + "Pictures" = { + id = "ziuj8-rm6dn"; + ignorePerms = true; + devices = ["ion" "legion" "monarch" "northstar" "vanguard"]; + }; + "Xochitl" = { + id = "dkcbx-kq7hl"; + type = "receiveonly"; + ignorePerms = true; + devices = ["legion" "remarkable"]; + }; + "Zotero" = { + id = "huyvn-liwc9"; + ignorePerms = true; + devices = ["ion" "legion" "monarch" "northstar" "vanguard" "N0245"]; }; }; }; diff --git a/services/syncthing/devices/H0615.nix b/services/syncthing/devices/H0615.nix deleted file mode 100644 index 2c8eeacc..00000000 --- a/services/syncthing/devices/H0615.nix +++ /dev/null @@ -1 +0,0 @@ -{...}: {services.syncthing.devices."H0615".id = "VVKKUT6-DMNEJ6J-ZI2QREG-SOLG7S5-V2V6WN3-UCQH2EN-6S2XXLS-FKN6KQF";} diff --git a/services/syncthing/devices/Ion.nix b/services/syncthing/devices/Ion.nix deleted file mode 100644 index 260e77ad..00000000 --- a/services/syncthing/devices/Ion.nix +++ /dev/null @@ -1 +0,0 @@ -{...}: {services.syncthing.devices."ion".id = "7DD4NPH-6T2ET5A-4FCLFWW-CS6UR2W-IO5XQXC-DM5B2Q4-6X7DGU2-UKKVEAB";} diff --git a/services/syncthing/devices/J0162.nix b/services/syncthing/devices/J0162.nix deleted file mode 100644 index 4b1d614f..00000000 --- a/services/syncthing/devices/J0162.nix +++ /dev/null @@ -1 +0,0 @@ -{...}: {services.syncthing.devices."J0162".id = "NTMLN4U-RPYURFR-P322MUO-2WJGAAF-CLV3RLL-SDUNLTD-4AXVIWG-GBDY3AF";} diff --git a/services/syncthing/devices/Legion.nix b/services/syncthing/devices/Legion.nix deleted file mode 100644 index 4d61902c..00000000 --- a/services/syncthing/devices/Legion.nix +++ /dev/null @@ -1 +0,0 @@ -{...}: {services.syncthing.devices."legion".id = "6OX54CG-EAQMXKA-K7TXB5P-G5A27HB-52JE2FA-XNAYZU6-YMIDBXP-RKPBJQV";} diff --git a/services/syncthing/devices/Monarch.nix b/services/syncthing/devices/Monarch.nix deleted file mode 100644 index 26a8c81f..00000000 --- a/services/syncthing/devices/Monarch.nix +++ /dev/null @@ -1 +0,0 @@ -{...}: {services.syncthing.devices."monarch".id = "CJSUZQY-67XBLEZ-VKVHQHI-BLEUZNF-G4237AV-AW44CGH-F3JDKXU-CWT3RQZ";} diff --git a/services/syncthing/devices/Northstar.nix b/services/syncthing/devices/Northstar.nix deleted file mode 100644 index e5bfa88d..00000000 --- a/services/syncthing/devices/Northstar.nix +++ /dev/null @@ -1 +0,0 @@ -{...}: {services.syncthing.devices."northstar".id = "W3QZTFS-BB42JYB-NQBZ5IM-H3WLAUQ-M57I2CP-FALWGEX-JI2ZZOC-QWAX2QQ";} diff --git a/services/syncthing/devices/Remarkable.nix b/services/syncthing/devices/Remarkable.nix deleted file mode 100644 index 6cc34103..00000000 --- a/services/syncthing/devices/Remarkable.nix +++ /dev/null @@ -1 +0,0 @@ -{...}: {services.syncthing.devices."remarkable".id = "GHB6JKS-JOA3HHP-TYHB3IJ-GLV26QW-RWRZAMG-XYFGFB6-QLUHDSH-GNPZVAO";} diff --git a/services/syncthing/devices/Vanguard.nix b/services/syncthing/devices/Vanguard.nix deleted file mode 100644 index cfe9162d..00000000 --- a/services/syncthing/devices/Vanguard.nix +++ /dev/null @@ -1 +0,0 @@ -{...}: {services.syncthing.devices."vanguard".id = "I366QNQ-D3FTDRX-RNOTXMW-YITZXOF-DSCDMQD-63Q72LI-ME2Y4HZ-T34RMQK";} diff --git a/services/syncthing/devices/default.nix b/services/syncthing/devices/default.nix deleted file mode 100644 index 6d45a093..00000000 --- a/services/syncthing/devices/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - imports = [ - ./Ion.nix - ./Legion.nix - ./Monarch.nix - ./Northstar.nix - ./Remarkable.nix - ./Vanguard.nix - ]; -} diff --git a/services/syncthing/folders/archive.nix b/services/syncthing/folders/archive.nix deleted file mode 100644 index b7ba1514..00000000 --- a/services/syncthing/folders/archive.nix +++ /dev/null @@ -1,11 +0,0 @@ -{lib, ...}: { - imports = [../devices]; - services.syncthing.folders."Archive" = { - label = "Archive"; - path = lib.mkDefault "/var/lib/syncthing/Archive/"; - id = "hwnqy-xzcdx"; - ignorePerms = true; - devices = lib.mkDefault ["legion" "monarch" "vanguard"]; - enable = true; - }; -} diff --git a/services/syncthing/folders/books.nix b/services/syncthing/folders/books.nix deleted file mode 100644 index 2d9b05c5..00000000 --- a/services/syncthing/folders/books.nix +++ /dev/null @@ -1,17 +0,0 @@ -{lib, ...}: { - imports = [../devices]; - services.syncthing.folders."Books" = { - label = "Books"; - path = lib.mkDefault "/var/lib/syncthing/Books/"; - id = "zjmxy-ycmbq"; - ignorePerms = true; - devices = lib.mkDefault [ - "legion" - "monarch" - "northstar" - "remarkable" - "vanguard" - ]; - enable = true; - }; -} diff --git a/services/syncthing/folders/camera.nix b/services/syncthing/folders/camera.nix deleted file mode 100644 index bd2b87fa..00000000 --- a/services/syncthing/folders/camera.nix +++ /dev/null @@ -1,12 +0,0 @@ -{lib, ...}: { - imports = [../devices]; - services.syncthing.folders."Camera" = { - label = "Camera"; - path = lib.mkDefault "/var/lib/syncthing/Camera/"; - id = "fp4_4j7w-photos"; - type = "receiveonly"; - ignorePerms = true; - devices = lib.mkDefault []; - enable = false; - }; -} diff --git a/services/syncthing/folders/comics.nix b/services/syncthing/folders/comics.nix deleted file mode 100644 index 4295af66..00000000 --- a/services/syncthing/folders/comics.nix +++ /dev/null @@ -1,17 +0,0 @@ -{lib, ...}: { - imports = [../devices]; - services.syncthing.folders."Comics" = { - label = "Comics"; - path = lib.mkDefault "/var/lib/syncthing/Comics/"; - id = "kc2h0-q3wot"; - ignorePerms = true; - devices = lib.mkDefault [ - "ion" - "legion" - "monarch" - "northstar" - "vanguard" - ]; - enable = true; - }; -} diff --git a/services/syncthing/folders/documents.nix b/services/syncthing/folders/documents.nix deleted file mode 100644 index 7bccc417..00000000 --- a/services/syncthing/folders/documents.nix +++ /dev/null @@ -1,16 +0,0 @@ -{lib, ...}: { - imports = [../devices]; - services.syncthing.folders."Documents" = { - label = "Documents"; - path = lib.mkDefault "/var/lib/syncthing/Documents/"; - id = "qc6qa-bipsd"; - ignorePerms = true; - devices = lib.mkDefault [ - "legion" - "monarch" - "northstar" - "vanguard" - ]; - enable = true; - }; -} diff --git a/services/syncthing/folders/exports.nix b/services/syncthing/folders/exports.nix deleted file mode 100644 index 1801e3e5..00000000 --- a/services/syncthing/folders/exports.nix +++ /dev/null @@ -1,11 +0,0 @@ -{lib, ...}: { - imports = [../devices]; - services.syncthing.folders."Exports" = { - label = "Exports"; - path = lib.mkDefault "/var/lib/syncthing/Exports/"; - id = "tof2e-pdtde"; - ignorePerms = true; - devices = lib.mkDefault ["legion" "monarch" "vanguard"]; - enable = true; - }; -} diff --git a/services/syncthing/folders/movies.nix b/services/syncthing/folders/movies.nix deleted file mode 100644 index 35391ff2..00000000 --- a/services/syncthing/folders/movies.nix +++ /dev/null @@ -1,11 +0,0 @@ -{lib, ...}: { - imports = [../devices]; - services.syncthing.folders."Movies" = { - label = "Movies"; - path = lib.mkDefault "/var/lib/syncthing/Movies/"; - id = "3f75o-4x6sq"; - ignorePerms = true; - devices = lib.mkDefault []; - enable = false; - }; -} diff --git a/services/syncthing/folders/notes.nix b/services/syncthing/folders/notes.nix deleted file mode 100644 index ea6a198a..00000000 --- a/services/syncthing/folders/notes.nix +++ /dev/null @@ -1,17 +0,0 @@ -{lib, ...}: { - imports = [../devices]; - services.syncthing.folders."Notes" = { - label = "Notes"; - path = lib.mkDefault "/var/lib/syncthing/Notes/"; - id = "4ggjz-5dyop"; - ignorePerms = true; - devices = lib.mkDefault [ - "ion" - "legion" - "monarch" - "northstar" - "vanguard" - ]; - enable = true; - }; -} diff --git a/services/syncthing/folders/pictures.nix b/services/syncthing/folders/pictures.nix deleted file mode 100644 index f8045654..00000000 --- a/services/syncthing/folders/pictures.nix +++ /dev/null @@ -1,17 +0,0 @@ -{lib, ...}: { - imports = [../devices]; - services.syncthing.folders."Pictures" = { - label = "Pictures"; - path = lib.mkDefault "/var/lib/syncthing/Pictures/"; - id = "ziuj8-rm6dn"; - ignorePerms = true; - devices = lib.mkDefault [ - "ion" - "legion" - "monarch" - "northstar" - "vanguard" - ]; - enable = true; - }; -} diff --git a/services/syncthing/folders/xochitl.nix b/services/syncthing/folders/xochitl.nix deleted file mode 100644 index ba4a121d..00000000 --- a/services/syncthing/folders/xochitl.nix +++ /dev/null @@ -1,12 +0,0 @@ -{lib, ...}: { - imports = [../devices]; - services.syncthing.folders."Xochitl" = { - label = "Xochitl"; - path = lib.mkDefault "/var/lib/syncthing/Xochitl/"; - id = "dkcbx-kq7hl"; - type = "receiveonly"; - ignorePerms = true; - devices = lib.mkDefault ["legion" "remarkable"]; - enable = true; - }; -} diff --git a/services/syncthing/folders/zotero.nix b/services/syncthing/folders/zotero.nix deleted file mode 100644 index ef9e99b7..00000000 --- a/services/syncthing/folders/zotero.nix +++ /dev/null @@ -1,11 +0,0 @@ -{lib, ...}: { - imports = [../devices]; - services.syncthing.folders."Zotero" = { - label = "Zotero"; - path = lib.mkDefault "/var/lib/syncthing/Zotero/"; - id = "huyvn-liwc9"; - ignorePerms = true; - devices = lib.mkDefault ["ion" "legion"]; - enable = true; - }; -}