From 4813284e8256579e4f3904f9343f7690d8269ff1 Mon Sep 17 00:00:00 2001 From: Schweby mit Hut Date: Wed, 27 Jan 2021 23:27:59 +0100 Subject: [PATCH] syncthing --- hosts/hainich/configuration.nix | 1 + hosts/hainich/services/syncthing.nix | 42 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 hosts/hainich/services/syncthing.nix diff --git a/hosts/hainich/configuration.nix b/hosts/hainich/configuration.nix index db675c1..d5145fb 100644 --- a/hosts/hainich/configuration.nix +++ b/hosts/hainich/configuration.nix @@ -16,6 +16,7 @@ ./services/docker.nix ./services/gitlab-runner.nix ./services/lantifa.nix + ./services/syncthing.nix ]; boot.loader.grub.enable = true; boot.loader.grub.version = 2; diff --git a/hosts/hainich/services/syncthing.nix b/hosts/hainich/services/syncthing.nix new file mode 100644 index 0000000..792f533 --- /dev/null +++ b/hosts/hainich/services/syncthing.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: +{ + services.syncthing = { + enable = true; + relay.enable = false; + openDefaultPorts = true; + declarative = { + devices = { + txsbcct = { + addresses = []; # empty = dynamic + id = "A6SRBZL-CP627PX-4QA55B7-QKJXOMO-UJDXQIV-77OK57V-RXO3CUQ-JIHX7AC"; + }; + octycs = { + addresses = []; # empty = dynamic + id = "KIJVGWZ-GRXPAUX-ZOTZDLS-KUKANCC-A2IBZRM-BT3RZK7-5M43O6R-OZD5IQE"; + }; + stuebinm-desktop = { + addresses = []; # empty = dynamic + id = "CWZTKG7-F45LE2O-TIT6IBC-RQD6MLH-K5ECUGJ-LOHJXF3-I2F4R6I-JVMRLAJ"; + }; + conway = { + addresses = []; # empty = dynamic + id = "HV7IU2N-Q4W3A7F-BSASR43-OB575SM-47FY2UW-7N5GMFM-PX3LWRN-HXBXMQF"; + }; + }; + + folders = { + "/var/lib/syncthing/hacc" = { + id = "qt2ly-xvvvs"; + devices = [ "txsbcct" "octycs" "stuebinm-desktop" "conway" ]; + type = "receiveonly"; + versioning = { + type = "simple"; + params.keep = "10"; + }; + }; + }; + + }; + + }; +}