home

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

commit e37be633c29da96e0a864287318b9940cd5d8160
parent ff93d39b89107134f4e9d7388a11d09b2c84819a
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Tue, 14 Sep 2021 12:16:41 +0200

systems: initial syncthing setup for aomi…

… I need to enhance this now to have all devices and have a filter to
not include the current configuration (using config.networking.hostName)

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

Diffstat:
Msystems/modules/profiles/home.nix | 1+
Msystems/modules/profiles/syncthing.nix | 53++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/systems/modules/profiles/home.nix b/systems/modules/profiles/home.nix @@ -32,6 +32,7 @@ in "${home.ips.okinawa}" = [ "okinawa.home" ]; "${wireguard.ips.okinawa}" = [ "okinawa.vpn" ]; "${wireguard.ips.kerkouane}" = [ "kerkouane.vpn" ]; + "${wireguard.ips.naruhodo}" = [ "naruhodo.vpn" ]; }; }; time.timeZone = "Europe/Paris"; diff --git a/systems/modules/profiles/syncthing.nix b/systems/modules/profiles/syncthing.nix @@ -3,6 +3,27 @@ with lib; let cfg = config.profiles.syncthing; + 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" ]; + # }; + naruhodo = { + id = "VTIA5EJ-X2BAMN6-LSBUFVJ-EZ35MTN-AOCEQEZ-HMY7CGV-STVVFTT-5U7SIAY"; + addresses = [ "tcp://naruhodo.vpn" "tcp://naruhodo.home" ]; + # addresses = [ "tcp://192.168.1.2" "tcp://void.home" ]; + }; + sakhalin = { + id = "4TYYG7V-A67D5SN-HMEJCI7-POOZRLL-RNCIE4U-ZYVGTOB-JQ5DOSV-ZCGWUAL"; + addresses = [ "tcp://sakhalin.home" "tcp://sakhalin.vpn" ]; + }; + wakasu = { + id = "XNCACMA-LMIZPRZ-J6LEMR5-BVI7IVQ-6HWWMUU-QUCA63X-ZE32NOP-QFDDGQM"; + addresses = [ "tcp://wakasu.home" "tcp://wakasu.vpn" ]; + }; + }; + deviceNames = builtins.attrNames devices; in { options = { @@ -16,7 +37,37 @@ in user = "vincent"; dataDir = "/home/vincent/.syncthing"; configDir = "/home/vincent/.syncthing"; - openDefaultPorts = true; + # openDefaultPorts = true; + declarative = { + inherit devices; + folders = { + "/home/vincent/sync" = { + label = "sync"; + id = "7dshg-r8zr6"; + devices = deviceNames; + }; + "/home/vincent/desktop/org" = { + label = "org"; + id = "sjpsr-xfwdu"; + devices = deviceNames; + }; + "/home/vincent/desktop/documents" = { + label = "documents"; + id = "oftdb-t5anv"; + devices = deviceNames; + }; + "/home/vincent/desktop/pictures/screenshots" = { + label = "screenshots"; + id = "prpsz-azlz9"; + devices = deviceNames; + }; + "/home/vincent/desktop/pictures/wallpapers" = { + label = "wallpapers"; + id = "wpiah-ydwwx"; + devices = deviceNames; + }; + }; + }; }; }; }