diff --git a/ops/nixos/swann/default.nix b/ops/nixos/swann/default.nix index 42f340f188..6dc8904600 100644 --- a/ops/nixos/swann/default.nix +++ b/ops/nixos/swann/default.nix @@ -192,6 +192,10 @@ in { internalInterfaces = ["en-general"]; externalInterface = "en-virginmedia"; extraCommands = '' + # Send PS5 RTMP to totoro instead. + # See DHCP static lease. + iptables -w -t nat -A nixos-nat-pre --src 92.118.30.18 -p tcp --dport 1935 -j DNAT --to-destination 192.168.1.40 + # NAT packets going over EE plain. iptables -w -t nat -A nixos-nat-post -m mark --mark 1 -o en-ee -j MASQUERADE @@ -273,6 +277,7 @@ in { { hostName = "ps5"; ethernetAddress = "bc:33:29:26:01:5c"; + # This is used for DNAT on RTMP, above. ipAddress = "92.118.30.18"; } ]; diff --git a/ops/nixos/totoro/default.nix b/ops/nixos/totoro/default.nix index a5802dd554..6830d37832 100644 --- a/ops/nixos/totoro/default.nix +++ b/ops/nixos/totoro/default.nix @@ -115,6 +115,25 @@ in { services.nginx = { enable = true; + package = pkgs.nginxMainline; + additionalModules = with pkgs.nginxModules; [ + rtmp + ]; + appendConfig = '' + rtmp { + server { + listen 1935; + chunk_size 4000; + application app { + live on; + record off; + allow publish all; + allow play all; + push rtmp://coventry.beam.bfob.gg/beam/thecakeisalie; + } + } + } + ''; virtualHosts = { "invoices.lukegb.com" = let fastcgi = {