2020-09-15 17:21:28 +02:00
|
|
|
{ hostAddress
|
|
|
|
, localAddress
|
|
|
|
, syncthingPort ? 22000
|
2020-12-30 09:10:30 +01:00
|
|
|
, syncthingLocalAnnouncePort ? 21027
|
2020-09-15 17:21:28 +02:00
|
|
|
}:
|
2019-02-08 23:52:22 +01:00
|
|
|
|
2020-09-15 17:21:28 +02:00
|
|
|
{
|
2020-09-14 19:38:36 +02:00
|
|
|
|
2019-02-08 23:52:22 +01:00
|
|
|
config = { config, pkgs, ... }: {
|
|
|
|
imports = [
|
|
|
|
../profiles/containers/configuration.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
networking.firewall.enable = true;
|
2019-03-06 13:53:37 +01:00
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
# syncthing gui
|
|
|
|
8384
|
|
|
|
];
|
2019-02-08 23:52:22 +01:00
|
|
|
|
|
|
|
services.syncthing = {
|
|
|
|
enable = true;
|
|
|
|
openDefaultPorts = true;
|
2019-03-06 13:53:37 +01:00
|
|
|
guiAddress = "0.0.0.0:8384";
|
2019-02-08 23:52:22 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
autoStart = true;
|
|
|
|
|
|
|
|
bindMounts = {
|
|
|
|
"/var/lib/syncthing/" = {
|
|
|
|
hostPath = "/var/lib/container-volumes/syncthing/var-lib-syncthing";
|
|
|
|
isReadOnly = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
privateNetwork = true;
|
|
|
|
forwardPorts = [
|
|
|
|
{
|
|
|
|
containerPort = 22000;
|
2020-09-14 19:38:36 +02:00
|
|
|
hostPort = syncthingPort;
|
2019-02-08 23:52:22 +01:00
|
|
|
protocol = "tcp";
|
|
|
|
}
|
2020-12-30 09:10:30 +01:00
|
|
|
{
|
|
|
|
containerPort = 21027;
|
|
|
|
hostPort = syncthingLocalAnnouncePort;
|
|
|
|
protocol = "tcp";
|
|
|
|
}
|
2019-02-08 23:52:22 +01:00
|
|
|
];
|
2020-09-15 17:21:28 +02:00
|
|
|
|
|
|
|
inherit hostAddress localAddress;
|
2019-02-08 23:52:22 +01:00
|
|
|
}
|