From 35759a84a0f155427b729ad3dbcf543683008a73 Mon Sep 17 00:00:00 2001 From: Linnnus Date: Tue, 13 May 2025 15:57:35 +0200 Subject: Set up syncthing on ahmed --- hosts/ahmed/syncthing/syncthing.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 hosts/ahmed/syncthing/syncthing.nix (limited to 'hosts/ahmed/syncthing/syncthing.nix') diff --git a/hosts/ahmed/syncthing/syncthing.nix b/hosts/ahmed/syncthing/syncthing.nix new file mode 100644 index 0000000..14a7bc7 --- /dev/null +++ b/hosts/ahmed/syncthing/syncthing.nix @@ -0,0 +1,30 @@ +# This module sets up syncthing on the server. It's very important because +# muhammed and boox-tablet seldom are online on the same network at the same +# time. +{config, ...}: { + services.syncthing = { + enable = true; + + key = config.age.secrets.syncthing-key.path; + cert = config.age.secrets.syncthing-cert.path; + + settings = { + folders = { + "ebooks" = { + lable = "Ebooks"; + path = "~/Synced ebooks"; # Recall that `~syncthing` is `/var/lib/syntching`. + copyOwnershipFromParent = true; + devices = ["muhammed" "boox-tablet"]; + }; + }; + + devices = { + boox-tablet.id = "SFQMOCB-TPRTXLD-WDL3REL-2XINQDR-3PZQ5IT-KX4PGXX-2VJO3JZ-2K2XNQ3"; + muhammed.id = "ZLKZCO5-K3GX3S6-PTLB5B6-ETRBPQT-6ZCKHYV-FXQNDPI-CGYRSO4-NIRPQAY"; + }; + }; + }; + + age.secrets.syncthing-key.file = ../../../secrets/syncthing-keys/ahmed/key.pem.age; + age.secrets.syncthing-cert.file = ../../../secrets/syncthing-keys/ahmed/cert.pem.age; +} -- cgit v1.2.3