home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit b40498912834c690a4e428ec553c310e7b7269ed
parent e37be633c29da96e0a864287318b9940cd5d8160
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Tue, 14 Sep 2021 12:29:37 +0200

systems: filter current host in syncthing module

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Msystems/modules/profiles/syncthing.nix | 13+++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/systems/modules/profiles/syncthing.nix b/systems/modules/profiles/syncthing.nix @@ -3,12 +3,13 @@ with lib; let cfg = config.profiles.syncthing; + isCurrentHost = n: v: n != config.networking.hostName; devices = { # TODO: Filter current devices from devices and folders.devices - # aomi = { - # id = "WAD7GYV-RXIL3V3-OT5PFZH-NRQHZWV-D3TGJVR-G4IANXZ-HTO5VT7-XE2WIQQ"; - # address = [ "tcp://aomi.vpn" "tcp://aomi.home" ]; - # }; + aomi = { + id = "WAD7GYV-RXIL3V3-OT5PFZH-NRQHZWV-D3TGJVR-G4IANXZ-HTO5VT7-XE2WIQQ"; + address = [ "tcp://aomi.vpn" "tcp://aomi.home" ]; + }; naruhodo = { id = "VTIA5EJ-X2BAMN6-LSBUFVJ-EZ35MTN-AOCEQEZ-HMY7CGV-STVVFTT-5U7SIAY"; addresses = [ "tcp://naruhodo.vpn" "tcp://naruhodo.home" ]; @@ -23,7 +24,7 @@ let addresses = [ "tcp://wakasu.home" "tcp://wakasu.vpn" ]; }; }; - deviceNames = builtins.attrNames devices; + deviceNames = builtins.attrNames (filterAttrs isCurrentHost devices); in { options = { @@ -39,7 +40,7 @@ in configDir = "/home/vincent/.syncthing"; # openDefaultPorts = true; declarative = { - inherit devices; + devices = filterAttrs isCurrentHost devices; folders = { "/home/vincent/sync" = { label = "sync";