diff --git a/nix/os/containers/syncthing.nix b/nix/os/containers/syncthing.nix new file mode 100644 index 0000000..93481ff --- /dev/null +++ b/nix/os/containers/syncthing.nix @@ -0,0 +1,36 @@ +{ ... } @ args: + +let + +in args // { + config = { config, pkgs, ... }: { + imports = [ + ../profiles/containers/configuration.nix + ]; + + networking.firewall.enable = true; + + services.syncthing = { + enable = true; + openDefaultPorts = true; + }; + }; + + autoStart = true; + + bindMounts = { + "/var/lib/syncthing/" = { + hostPath = "/var/lib/container-volumes/syncthing/var-lib-syncthing"; + isReadOnly = false; + }; + }; + + privateNetwork = true; + forwardPorts = [ + { + containerPort = 22000; + hostPort = 22000; + protocol = "tcp"; + } + ]; +} diff --git a/nix/os/devices/vmd32387.contaboserver.net/pkg.nix b/nix/os/devices/vmd32387.contaboserver.net/pkg.nix index 277d01a..3ba136a 100644 --- a/nix/os/devices/vmd32387.contaboserver.net/pkg.nix +++ b/nix/os/devices/vmd32387.contaboserver.net/pkg.nix @@ -7,11 +7,6 @@ { home-manager.users.steveej = import ../../../home-manager/configuration/text-minimal.nix; - services.syncthing = { - enable = true; - openDefaultPorts = true; - }; - services.hydra = { enable = false; hydraURL = "http://localhost:3000"; # externally visible URL diff --git a/nix/os/devices/vmd32387.contaboserver.net/system.nix b/nix/os/devices/vmd32387.contaboserver.net/system.nix index 51dc7b4..6d4ff00 100644 --- a/nix/os/devices/vmd32387.contaboserver.net/system.nix +++ b/nix/os/devices/vmd32387.contaboserver.net/system.nix @@ -80,5 +80,10 @@ in { hostAddress = "192.168.100.12"; localAddress = "192.168.100.13"; }; + + syncthing = import ../../containers/syncthing.nix { + hostAddress = "192.168.100.14"; + localAddress = "192.168.100.15"; + }; }; }