diff options
author | lassulus <lassulus@lassul.us> | 2019-05-29 15:47:34 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2019-05-29 15:54:14 +0200 |
commit | b216553984b5b3fadb297bdf2f8f019daa1c957b (patch) | |
tree | 6c6a5ad0067f19489f98a0aafaca88c89d08fe07 /lass/2configs/syncthing.nix | |
parent | 65c2a882482a8c9ceeebff68dc38be83ab44ee12 (diff) |
l syncthing: don't share sync with phone
Diffstat (limited to 'lass/2configs/syncthing.nix')
-rw-r--r-- | lass/2configs/syncthing.nix | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lass/2configs/syncthing.nix b/lass/2configs/syncthing.nix index 48f2625c1..25712f4f3 100644 --- a/lass/2configs/syncthing.nix +++ b/lass/2configs/syncthing.nix @@ -1,5 +1,7 @@ { config, pkgs, ... }: with import <stockholm/lib>; let - peers = mapAttrs (n: v: { id = v.syncthing.id; }) (filterAttrs (n: v: v.syncthing.id != null) config.krebs.hosts); + all_peers = filterAttrs (n: v: v.syncthing.id != null) config.krebs.hosts; + own_peers = filterAttrs (n: v: v.owner.name == "lass") all_peers; + mk_peers = mapAttrs (n: v: { id = v.syncthing.id; }); in { services.syncthing = { enable = true; @@ -14,8 +16,8 @@ in { enable = true; cert = toString <secrets/syncthing.cert>; key = toString <secrets/syncthing.key>; - peers = peers; - folders."/home/lass/sync".peers = attrNames peers; + peers = mk_peers all_peers; + folders."/home/lass/sync".peers = attrNames (filterAttrs (n: v: n != "phone") own_peers); }; system.activationScripts.syncthing-home = '' |