summaryrefslogtreecommitdiffstats
path: root/lass/2configs/syncthing.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2019-04-26 20:35:52 +0200
committermakefu <github@syntax-fehler.de>2019-04-26 20:35:52 +0200
commit2685464a60f32c75cf9198383ca10c3d6cf55572 (patch)
tree698bd32e2cc51be596771cc0e76ffd8521a64ff5 /lass/2configs/syncthing.nix
parent95f6a06c5acfb6054236ea2f5aee42975dd909ec (diff)
parentcd825d99342050bae35d5373e927ca999bae82cf (diff)
Merge branch 'master' of prism:stockholm
Diffstat (limited to 'lass/2configs/syncthing.nix')
-rw-r--r--lass/2configs/syncthing.nix20
1 files changed, 10 insertions, 10 deletions
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 <stockholm/lib>;
-{
+{ 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);
+in {
services.syncthing = {
enable = true;
group = "syncthing";
@@ -14,17 +14,17 @@ with import <stockholm/lib>;
enable = true;
cert = toString <secrets/syncthing.cert>;
key = toString <secrets/syncthing.key>;
- 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";
+ };
}