From cf206912772825135e779c05bd3d00bc3e99927b Mon Sep 17 00:00:00 2001 From: Swarsel Date: Sat, 20 Jul 2024 11:00:24 +0200 Subject: [PATCH] feat: manage syncthing through NixOS instead used to be done with home-manager --- SwarselSystems.org | 53 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/SwarselSystems.org b/SwarselSystems.org index 45655af..4b06cc9 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -4912,7 +4912,8 @@ Some programs profit from being installed through dedicated NixOS settings on sy }; #+end_src -Also, we setup zsh. Do not touch this. +**** zsh +Do not touch this. #+begin_src nix :tangle profiles/common/nixos.nix @@ -4921,6 +4922,54 @@ Also, we setup zsh. Do not touch this. environment.shells = with pkgs; [ zsh ]; environment.pathsToLink = [ "/share/zsh" ]; +#+end_src +**** syncthing + +#+begin_src nix :tangle profiles/common/nixos.nix + + services.syncthing = { + enable = true; + user = "swarsel"; + dataDir = "/home/swarsel"; + configDir = "/home/swarsel/.config/syncthing"; + openDefaultPorts = true; + settings = { + devices = { + "magicant" = { + id = "SEH2NMT-IVRQUU5-VPW2HUQ-3GQYDBF-F6H6OY6-X3DZTUZ-LCRE2DJ-QNIXIQ2"; + }; + "sync (@oracle)" = { + id = "ETW6TST-NPK7MKZ-M4LXMHA-QUPQHDT-VTSHH5X-CR5EIN2-YU7E55F-MGT7DQB"; + }; + "server1" = { + id = "ZXWVC4X-IIARITZ-MERZPHN-HD55Y6G-QJM2GTB-6BWYXMR-DTO3TS2-QDBREQQ"; + }; + }; + folders = { + "Default Folder" = { + path = "/home/swarsel/Sync"; + devices = [ "sync (@oracle)" "magicant" ]; + id = "default"; + }; + "Obsidian" = { + path = "/home/swarsel/Nextcloud/Obsidian"; + devices = [ "sync (@oracle)" "magicant" ]; + id = "yjvni-9eaa7"; + }; + "Org" = { + path = "/home/swarsel/Nextcloud/Org"; + devices = [ "sync (@oracle)" "magicant" ]; + id = "a7xnl-zjj3d"; + }; + "Vpn" = { + path = "/home/swarsel/Vpn"; + devices = [ "sync (@oracle)" "magicant" ]; + id = "hgp9s-fyq3p"; + }; + }; + }; + }; + #+end_src *** Services @@ -6688,7 +6737,7 @@ Enables the syncthing service which talks to my syncthing instance on the Oracle #+begin_src nix :tangle profiles/common/home.nix services.syncthing = { - enable = true; + enable = false; tray = { enable = false; # we enable this by installing the syncthingtray package instead, it works better. };