about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-04-04T01·38+0000
committerVincent Ambo <tazjin@google.com>2020-04-04T01·39+0000
commit9caf09a2449e4af60c2f9de9a68020e780c2bebe (patch)
treebcda07e58385af47b1b40deffdeefb94e271c7f8
parentc3de37f54d27c89011775dea6d0890ac3343f5cc (diff)
feat(ops/nixos/camden): Enable RTMP support in nginx r/618
This makes it possible to live-stream various things at rtmp://tazj.in/tvl
-rw-r--r--ops/nixos/camden/default.nix26
1 files changed, 25 insertions, 1 deletions
diff --git a/ops/nixos/camden/default.nix b/ops/nixos/camden/default.nix
index 45ce3182681a..a978f8873aa4 100644
--- a/ops/nixos/camden/default.nix
+++ b/ops/nixos/camden/default.nix
@@ -75,7 +75,7 @@ in lib.fix(self: {
   networking = {
     hostName = "camden";
     interfaces.enp1s0.useDHCP = true;
-    firewall.allowedTCPPorts = [ 22 8080 80 443 ];
+    firewall.allowedTCPPorts = [ 22 8080 80 443 1935 ];
   };
 
   time.timeZone = "UTC";
@@ -188,11 +188,35 @@ in lib.fix(self: {
   services.nginx = {
     enable = true;
     enableReload = true;
+    package = with nixpkgs; nginx.override {
+      modules = [ nginxModules.rtmp ];
+    };
 
     recommendedTlsSettings = true;
     recommendedGzipSettings = true;
     recommendedProxySettings = true;
 
+
+    appendConfig = ''
+      rtmp_auto_push on;
+      rtmp {
+        server {
+          listen 1935;
+          chunk_size 4000;
+
+          application tvl {
+            live on;
+
+            allow publish 88.98.195.213;
+            allow publish 10.0.1.0/24;
+            deny publish all;
+
+            allow play all;
+          }
+        }
+      }
+    '';
+
     commonHttpConfig = ''
       log_format json_combined escape=json
       '{'