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