diff options
| author | Mike Vink <mike@pionative.com> | 2024-02-11 15:53:44 +0100 |
|---|---|---|
| committer | Mike Vink <mike@pionative.com> | 2024-02-11 15:53:44 +0100 |
| commit | 3cc299a59572c8c9c09b67fc26cfc699355447fd (patch) | |
| tree | 7ca17359497f4b439c3a3c7ddd9e7da629a0e1c4 /profiles/core/syncthing.nix | |
| parent | 2524a1b80a983d0e4ef4796477bd2a8c812acb69 (diff) | |
setup syncthing on lemptop and pump
Diffstat (limited to 'profiles/core/syncthing.nix')
| -rw-r--r-- | profiles/core/syncthing.nix | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/profiles/core/syncthing.nix b/profiles/core/syncthing.nix index e5c19f7..a1767a6 100644 --- a/profiles/core/syncthing.nix +++ b/profiles/core/syncthing.nix @@ -3,16 +3,51 @@ enable = true; user = ivi.username; inherit (config.ivi) group; + dataDir = config.ivi.home; overrideDevices = true; overrideFolders = true; key = config.secrets.syncthing.path; - settings = { + settings = let + allDevices = (filterAttrs (_: m: m.syncthing.id != "") ivi.machines); + in { + gui = { + theme = "default"; + insecureAdminAccess = true; + }; + devices = mapAttrs (_: m: { inherit (m.syncthing) id; introducer = m.isServer; - }) (filterAttrs (_: m: m.syncthing.enable) ivi.machines); + }) allDevices; + + folders = let + trashcan = { + type = "trashcan"; + params.cleanoutDays = "0"; + }; + simple = { + type = "simple"; + params = { + keep = "5"; + cleanoutDays = "0"; + }; + }; + allNames = attrNames allDevices; + in { + my = { + path = "${config.ivi.home}/sync/my"; + devices = allNames; + versioning = simple; + }; + pictures = { + path = "${config.ivi.home}/sync/pictures"; + devices = allNames; + versioning = trashcan; + }; + }; }; }; + environment.systemPackages = [config.services.syncthing.package]; } |
