2024-10-06 15:25:05 -05:00
|
|
|
{flake, ...}: let
|
2024-11-04 20:49:43 -06:00
|
|
|
inherit (flake.config.machines.devices) nas phone tablet;
|
|
|
|
inherit (flake.config.services.instances) syncthing web;
|
2024-10-19 18:22:29 -05:00
|
|
|
service = syncthing;
|
|
|
|
localhost = web.localhost.address0;
|
2024-10-06 15:25:05 -05:00
|
|
|
in {
|
|
|
|
services = {
|
|
|
|
syncthing = {
|
|
|
|
enable = true;
|
|
|
|
overrideDevices = false;
|
|
|
|
overrideFolders = false;
|
|
|
|
openDefaultPorts = true;
|
|
|
|
systemService = true;
|
2024-10-19 18:22:29 -05:00
|
|
|
guiAddress = "${localhost}:${toString service.ports.port0}";
|
2024-10-06 15:25:05 -05:00
|
|
|
settings = {
|
|
|
|
devices = {
|
|
|
|
${nas.name} = {
|
|
|
|
autoAcceptFolders = true;
|
|
|
|
name = nas.name;
|
|
|
|
addresses = [
|
2024-10-19 18:22:29 -05:00
|
|
|
"tcp://${nas.ip.address0}:${toString service.ports.port2}"
|
2024-10-06 15:25:05 -05:00
|
|
|
];
|
|
|
|
id = nas.sync;
|
|
|
|
};
|
|
|
|
${phone.name} = {
|
|
|
|
autoAcceptFolders = true;
|
|
|
|
name = phone.name;
|
|
|
|
addresses = [
|
2024-10-19 18:22:29 -05:00
|
|
|
"tcp://${phone.ip.address0}:${toString service.ports.port2}"
|
2024-10-06 15:25:05 -05:00
|
|
|
];
|
|
|
|
id = phone.sync;
|
|
|
|
};
|
|
|
|
${tablet.name} = {
|
|
|
|
autoAcceptFolders = true;
|
|
|
|
name = tablet.name;
|
|
|
|
addresses = [
|
2024-10-19 18:22:29 -05:00
|
|
|
"tcp://${tablet.ip.address0}:${toString service.ports.port2}"
|
2024-10-06 15:25:05 -05:00
|
|
|
];
|
|
|
|
id = tablet.sync;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
firewall = {
|
|
|
|
allowedTCPPorts = [
|
2024-10-19 18:22:29 -05:00
|
|
|
service.ports.port0
|
|
|
|
service.ports.port1
|
|
|
|
service.ports.port2
|
2024-10-06 15:25:05 -05:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|