From 2a89d6587d5ee5d3151b5e5be05e152a539e78d0 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 18 Apr 2019 10:16:02 +0200 Subject: l syncs: use permown, use attrs --- lass/2configs/syncthing.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lass/2configs/syncthing.nix') diff --git a/lass/2configs/syncthing.nix b/lass/2configs/syncthing.nix index fc10b2cb..48f2625c 100644 --- a/lass/2configs/syncthing.nix +++ b/lass/2configs/syncthing.nix @@ -1,6 +1,6 @@ -{ config, pkgs, ... }: -with import ; -{ +{ config, pkgs, ... }: with import ; let + peers = mapAttrs (n: v: { id = v.syncthing.id; }) (filterAttrs (n: v: v.syncthing.id != null) config.krebs.hosts); +in { services.syncthing = { enable = true; group = "syncthing"; @@ -14,17 +14,17 @@ with import ; enable = true; cert = toString ; key = toString ; - peers = mapAttrs (n: v: { id = v.syncthing.id; }) (filterAttrs (n: v: v.syncthing.id != null) config.krebs.hosts); - folders = [ - { path = "/home/lass/sync"; peers = [ "icarus" "mors" "skynet" "blue" "green" "littleT" "prism" "shodan" ]; } - ]; + peers = peers; + folders."/home/lass/sync".peers = attrNames peers; }; system.activationScripts.syncthing-home = '' ${pkgs.coreutils}/bin/chmod a+x /home/lass ''; - lass.ensure-permissions = [ - { folder = "/home/lass/sync"; owner = "lass"; group = "syncthing"; } - ]; + krebs.permown."/home/lass/sync" = { + owner = "lass"; + group = "syncthing"; + umask = "0007"; + }; } -- cgit v1.2.3