]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - virtual/packages.nix
Add ympd
[perso/Immae/Config/Nix.git] / virtual / packages.nix
index c257dab0a60b3e8ee3167be8e42ebca76242b48c..6d85411763972cb0d18f6e97dae99758e2115893 100644 (file)
@@ -62,7 +62,37 @@ let
         '';
     };
   };
+
+  ympd = rec {
+    config = {
+      webPort = "localhost:18001";
+      mpd = {
+        host = "malige.home.immae.eu";
+        port = 6600;
+      };
+    };
+    apache = {
+      vhostConf = ''
+        <LocationMatch "^/mpd">
+          Use LDAPConnect
+          Require ldap-group   cn=users,cn=mpd,ou=services,dc=immae,dc=eu
+          Require local
+        </LocationMatch>
+
+        RedirectMatch permanent "^/mpd$" "/mpd/"
+        <Location "/mpd/">
+          ProxyPass http://${config.webPort}/
+          ProxyPassReverse http://${config.webPort}/
+          ProxyPreserveHost on
+        </Location>
+        <Location "/mpd/ws">
+          ProxyPass ws://${config.webPort}/ws
+        </Location>
+      '';
+    };
+  };
 in
   {
     inherit adminer;
+    inherit ympd;
   }