infra/nix/os/containers/syncthing.nix
Stefan Junker 406ab7be7e run most containers and back them up at home
* switch backup from wasabi-s3 to btrfs via ssh
* add srv0 at home
* run webserver and syncthing at home
2021-01-07 19:40:17 +01:00

51 lines
932 B
Nix

{ hostAddress
, localAddress
, syncthingPort ? 22000
, syncthingLocalAnnouncePort ? 21027
}:
{
config = { config, pkgs, ... }: {
imports = [
../profiles/containers/configuration.nix
];
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [
# syncthing gui
8384
];
services.syncthing = {
enable = true;
openDefaultPorts = true;
guiAddress = "0.0.0.0:8384";
};
};
autoStart = true;
bindMounts = {
"/var/lib/syncthing/" = {
hostPath = "/var/lib/container-volumes/syncthing/var-lib-syncthing";
isReadOnly = false;
};
};
privateNetwork = true;
forwardPorts = [
{
containerPort = 22000;
hostPort = syncthingPort;
protocol = "tcp";
}
{
containerPort = 21027;
hostPort = syncthingLocalAnnouncePort;
protocol = "tcp";
}
];
inherit hostAddress localAddress;
}