summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/syncthing.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-06-14 18:36:13 +0200
committertv <tv@krebsco.de>2023-06-14 18:36:13 +0200
commitf9e82b4ffc5db0c53556bf068ffc8859828163ef (patch)
tree6ea55d0492ebb9458fec210c1ec59030e15c3187 /krebs/2configs/syncthing.nix
parente1ec606542ba602f8ebd95fe961a68aa70c012e4 (diff)
parentccf29b838bb6865f940597a1bd6e6cb4f3522b0c (diff)
Merge remote-tracking branch 'orange/master'
Diffstat (limited to 'krebs/2configs/syncthing.nix')
-rw-r--r--krebs/2configs/syncthing.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/krebs/2configs/syncthing.nix b/krebs/2configs/syncthing.nix
index dac1863d5..d6d42ca11 100644
--- a/krebs/2configs/syncthing.nix
+++ b/krebs/2configs/syncthing.nix
@@ -1,17 +1,21 @@
-{ config, pkgs, ... }: with import <stockholm/lib>; let
+{ options, config, pkgs, ... }: with import <stockholm/lib>; let
mk_peers = mapAttrs (n: v: { id = v.syncthing.id; });
all_peers = filterAttrs (n: v: v.syncthing.id != null) config.krebs.hosts;
- used_peer_names = unique (flatten (mapAttrsToList (n: v: v.devices) config.services.syncthing.declarative.folders));
+ used_peer_names = unique (filter isString (flatten (mapAttrsToList (n: v: v.devices) config.services.syncthing.folders)));
used_peers = filterAttrs (n: v: elem n used_peer_names) all_peers;
in {
services.syncthing = {
enable = true;
configDir = "/var/lib/syncthing";
- devices = mk_peers used_peers;
key = toString <secrets/syncthing.key>;
cert = toString <secrets/syncthing.cert>;
- };
+ # workaround for infinite recursion on unstable, remove in 23.11
+ } // (if builtins.hasAttr "settings" options.services.syncthing then
+ { settings.devices = mk_peers used_peers; }
+ else
+ { devices = mk_peers used_peers; }
+ );
boot.kernel.sysctl."fs.inotify.max_user_watches" = 524288;
}