From b02927de5f818bf8637f26c3dbb4bd172b835850 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Sat, 18 Jul 2015 12:33:29 +0200
Subject: 1 tv cd: make public_html available on the Internet

---
 1systems/tv/cd.nix | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

(limited to '1systems/tv/cd.nix')

diff --git a/1systems/tv/cd.nix b/1systems/tv/cd.nix
index 1252f16..4826a06 100644
--- a/1systems/tv/cd.nix
+++ b/1systems/tv/cd.nix
@@ -48,6 +48,20 @@ with lib;
       tv.iptables.input-internet-accept-new-tcp = singleton "http";
       tv.nginx.servers.cgit.server-names = singleton "cgit.cd.viljetic.de";
     }
+    {
+      # TODO make public_html also available to cd, cd.retiolum (AKA default)
+      imports = [
+        ../../3modules/tv/iptables.nix
+        ../../3modules/tv/nginx.nix
+      ];
+      tv.iptables.input-internet-accept-new-tcp = singleton "http";
+      tv.nginx.servers.public_html = {
+        server-names = singleton "cd.viljetic.de";
+        locations = singleton (nameValuePair "~ ^/~(.+?)(/.*)?\$" ''
+          alias /home/$1/public_html$2;
+        '');
+      };
+    }
     {
       imports = [ ../../3modules/tv/retiolum.nix ];
       tv.retiolum = {
-- 
cgit v1.2.3