]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add ympd
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 29 Dec 2018 10:03:03 +0000 (11:03 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 29 Dec 2018 10:03:03 +0000 (11:03 +0100)
virtual/eldiron.nix
virtual/packages.nix

index 50aaeab37edcba8f8fce2d9d6fd381445e4ee827..160595d0cc08ab16c52be6c699c8b304bc1b9fc7 100644 (file)
@@ -52,6 +52,8 @@
       };
     };
 
+    services.ympd = mypkgs.ympd.config // { enable = true; };
+
     # FIXME: open_basedir
     services.phpfpm = {
       extraConfig = ''
           documentRoot = null;
           extraConfig = builtins.concatStringsSep "\n" [
             mypkgs.adminer.apache.vhostConf
+            mypkgs.ympd.apache.vhostConf
           ];
         })
         { # Should go last, default fallback
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;
   }