mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 18:15:13 -05:00
64 lines
1.5 KiB
Nix
Executable file
64 lines
1.5 KiB
Nix
Executable file
{flake, ...}: let
|
|
inherit
|
|
(flake.config.machines.devices)
|
|
synology
|
|
phone
|
|
tablet
|
|
;
|
|
inherit
|
|
(flake.config.services.instances)
|
|
syncthing
|
|
web
|
|
;
|
|
service = syncthing;
|
|
localhost = web.localhost.address0;
|
|
in {
|
|
services = {
|
|
syncthing = {
|
|
enable = true;
|
|
overrideDevices = false;
|
|
overrideFolders = false;
|
|
openDefaultPorts = true;
|
|
systemService = true;
|
|
guiAddress = "${localhost}:${toString service.ports.port0}";
|
|
settings = {
|
|
devices = {
|
|
${synology.name} = {
|
|
autoAcceptFolders = true;
|
|
name = synology.name;
|
|
addresses = [
|
|
"tcp://${synology.ip.address0}:${toString service.ports.port2}"
|
|
];
|
|
id = synology.sync;
|
|
};
|
|
${phone.name} = {
|
|
autoAcceptFolders = true;
|
|
name = phone.name;
|
|
addresses = [
|
|
"tcp://${phone.ip.address0}:${toString service.ports.port2}"
|
|
];
|
|
id = phone.sync;
|
|
};
|
|
${tablet.name} = {
|
|
autoAcceptFolders = true;
|
|
name = tablet.name;
|
|
addresses = [
|
|
"tcp://${tablet.ip.address0}:${toString service.ports.port2}"
|
|
];
|
|
id = tablet.sync;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
networking = {
|
|
firewall = {
|
|
allowedTCPPorts = [
|
|
service.ports.port0
|
|
service.ports.port1
|
|
service.ports.port2
|
|
];
|
|
};
|
|
};
|
|
}
|