nixos-config/mastus/wstunnel.nix

27 lines
628 B
Nix
Raw Normal View History

2019-10-03 17:19:07 +00:00
{ config, pkgs, ... }:
let
wstunnel = with pkgs; haskell.lib.justStaticExecutables
(haskellPackages.callPackage ../pkgs/wstunnel.nix {});
port = 58613;
in
{
systemd.services.wstunnel = rec {
path = [ wstunnel ];
wantedBy = [ "nginx.service" ];
after = [ "network.target" ];
script = ''
2019-10-03 17:58:46 +00:00
wstunnel --server --restrictTo=htdf-gw.gebner.org:35869 ws://localhost:${toString port}
2019-10-03 17:19:07 +00:00
'';
};
services.nginx.virtualHosts."gebner.org".locations = {
"/wstunnel/udp/htdf-gw.gebner.org/35869" = {
proxyWebsockets = true;
proxyPass = "http://localhost:${toString port}";
};
};
}