This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

rework syncthing to not use stockholm

+16 -8
+16 -8
2configs/syncthing.nix
··· 2 2 let 3 3 4 4 shares = { 5 - "/home/lass/sync" = [ "mors" "xerxes" "green" "blue" "coaxmetal" "aergia" "ignavia" ]; 6 - "/home/lass/tmp/the_playlist" = [ "mors" "phone" "prism" "omo" "radio" ]; 5 + "/home/lass/sync" = [ "mors" "green" "coaxmetal" "ignavia" ]; # TODO add aergia 6 + "/home/lass/tmp/the_playlist" = [ "mors" "prism" "radio" ]; 7 7 # "/home/lass/.weechat" = [ "green" "mors" ]; 8 - "/home/lass/decsync" = [ "mors" "blue" "green" "phone" "massulus" ]; 8 + "/home/lass/decsync" = [ "mors" "green" "massulus" "massulus2" ]; 9 9 }; 10 10 11 - mk_peers = lib.mapAttrs (n: v: { id = v.syncthing.id; }); 11 + machine_peers = lib.foldr (host: acc: 12 + if builtins.pathExists ../machines/${host}/facts/syncthing.pub then 13 + acc // { ${host}.id = lib.removeSuffix "\n" (builtins.readFile ../machines/${host}/facts/syncthing.pub); } 14 + else 15 + acc 16 + ) {} (lib.attrNames (builtins.readDir ../machines)); 12 17 13 - all_peers = lib.filterAttrs (n: v: v.syncthing.id != null) config.krebs.hosts; 18 + all_peers = machine_peers // { 19 + "massulus".id = "R2EGJ5S-PQMETUP-C2UGXQG-A6VP7TB-NGSN3MV-C7OGSWT-SZ34L3X-H6IF6AQ"; 20 + "massulus2".id = "OTJBJNO-VHBCVDL-QSELUS7-S6JDMYR-7WLE36A-6XSRSLP-VKYOYJJ-AHFGZAG"; 21 + }; 22 + 14 23 used_peer_names = lib.unique (lib.filter lib.isString (lib.flatten (lib.mapAttrsToList (n: v: v.devices) config.services.syncthing.settings.folders))); 15 - used_peers = lib.filterAttrs (n: v: lib.elem n used_peer_names) all_peers; 24 + used_peers = lib.filterAttrs (n: v: lib.elem n used_peer_names) (lib.traceValSeq all_peers); 16 25 in { 17 26 services.syncthing = { 18 27 enable = true; ··· 20 29 configDir = "/var/lib/syncthing"; 21 30 key = "${config.krebs.secret.directory}/syncthing.key"; 22 31 cert = "${config.krebs.secret.directory}/syncthing.cert"; 23 - # workaround for infinite recursion on unstable, remove in 23.11 24 - settings.devices = mk_peers used_peers; 32 + settings.devices = used_peers; 25 33 settings.folders = lib.mapAttrs (share: devices: { 26 34 enable = lib.elem config.networking.hostName devices; 27 35 path = share;