test official zerotier-tcp-proxy

This commit is contained in:
Jörg Thalheim 2023-07-12 10:56:39 +02:00
parent 14a39f207d
commit ed9bb9b9e9
3 changed files with 10 additions and 7 deletions

View File

@ -25,7 +25,9 @@
serviceConfig = {
Type = "simple";
# imap port
ExecStart = "${pkgs.callPackage ../../pkgs/zt-tcp-relay.nix {}}/bin/zt-tcp-relay --listen [::]:993";
ExecStart = "${pkgs.callPackage ../../pkgs/zerotier-tcp-proxy.nix {
zerotierProxyPort = 993;
}}/bin/zerotier-tcp-proxy";
Restart = "always";
RestartSec = 5;
DynamicUser = true;

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, fetchpatch, zerotierone }:
{ stdenv, fetchFromGitHub, fetchpatch, zerotierProxyPort ? 443 }:
stdenv.mkDerivation {
name = "zerotier-tcp-proxy";
src = fetchFromGitHub {
@ -15,6 +15,7 @@ stdenv.mkDerivation {
];
buildPhase = ''
pushd tcp-proxy
sed -i -e "s/ZT_TCP_PROXY_TCP_PORT.*443/ZT_TCP_PROXY_TCP_PORT ${toString zerotierProxyPort}/g" tcp-proxy.cpp
cat tcp-proxy.cpp
make -j $NIX_BUILD_CORES CXX=$CXX
popd

File diff suppressed because one or more lines are too long