summaryrefslogtreecommitdiffstats
path: root/lass/2configs/syncthing.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2019-06-25 19:21:20 +0200
committertv <tv@krebsco.de>2019-06-25 20:16:12 +0200
commit8c667f09c0e6e412283c8d7982a7112123ba5c0c (patch)
tree983c08ee1f2e73fe6b3680a9fbf71866bb4ac173 /lass/2configs/syncthing.nix
parentd343910e98736a94431fcac3da21274d2ecec449 (diff)
parent153505206cba1896685bf1fd7252cffeae19e290 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'lass/2configs/syncthing.nix')
-rw-r--r--lass/2configs/syncthing.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/lass/2configs/syncthing.nix b/lass/2configs/syncthing.nix
index 48f2625c1..d4df17b9a 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 = ''
@@ -23,8 +25,9 @@ in {
'';
krebs.permown."/home/lass/sync" = {
+ file-mode = "u+rw,g+rw";
owner = "lass";
group = "syncthing";
- umask = "0007";
+ umask = "0002";
};
}