]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/tools/im/default.nix
Fix converse
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / im / default.nix
index 372fa323e465ffa3a2529f858888eb4f96335cad..6420077b11ddd9c7f881d6206a717fd6e3b979f9 100644 (file)
@@ -1,6 +1,11 @@
 { config, lib, pkgs, ... }:
 let
   cfg = config.myServices.websites.tools.im;
+  converseVersion = "9.1.1";
+  www = pkgs.runCommand "www" {} ''
+    cp -a ${./www} $out
+    substituteInPlace $out/converse.html --replace {{converseVersion}} ${converseVersion}
+  '';
 in
 {
   options.myServices.websites.tools.im = {
@@ -79,11 +84,11 @@ in
       certName   = "eldiron";
       addToCerts = true;
       hosts      = ["im.immae.fr"];
-      root       = ./www;
+      root       = www;
       extraConfig = [
         ''
           Alias /glowing-bear ${pkgs.glowing-bear}
-          Alias /converse ${./www}/converse.html
+          Alias /converse ${www}/converse.html
           ProxyPreserveHost On
           <Location "/bosh">
             ProxyPass http://localhost:5280/bosh
@@ -99,8 +104,12 @@ in
           ProxyPass /api http://localhost:5280/api
           ProxyPassReverse /api http://localhost:5280/api
           <Directory ${pkgs.glowing-bear}>
-          AllowOverride none
-          Require all granted
+            AllowOverride none
+            Require all granted
+          </Directory>
+          <Directory ${www}>
+            Require all granted
+            AllowOverride none
           </Directory>
           ''
       ];