]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/tools/tools/default.nix
Add bouya.org and outils.immae.eu domains
[perso/Immae/Config/Nix.git] / nixops / modules / websites / tools / tools / default.nix
index 5db7d3eb5a3e7d4127922ae49186a83fdc7fcd26..e0181c4f82a9bcd4d616e654fe818334b690ae92 100644 (file)
@@ -59,6 +59,7 @@ in {
       extraConfig = [
         ''
           <Directory "/var/lib/ftp/tools.immae.eu">
+            DirectoryIndex index.php index.htm index.html
             AllowOverride all
             Require all granted
             <FilesMatch "\.php$">
@@ -79,6 +80,32 @@ in {
       ];
     };
 
+    security.acme.certs."eldiron".extraDomains."outils.immae.eu" = null;
+    services.myWebsites.tools.vhostConfs.outils = {
+      certName = "eldiron";
+      hosts    = [ "outils.immae.eu" ];
+      root     = null;
+      extraConfig = [
+        ''
+        RedirectMatch 301 ^/mediagoblin(.*)$ https://mgoblin.immae.eu$1
+
+        RedirectMatch 301 ^/ether(.*)$       https://ether.immae.eu$1
+
+        RedirectMatch 301 ^/nextcloud(.*)$   https://cloud.immae.eu$1
+        RedirectMatch 301 ^/owncloud(.*)$    https://cloud.immae.eu$1
+
+        RedirectMatch 301 ^/carddavmate(.*)$ https://dav.immae.eu/infcloud$1
+        RedirectMatch 301 ^/caldavzap(.*)$   https://dav.immae.eu/infcloud$1
+        RedirectMatch 301 ^/caldav.php(.*)$  https://dav.immae.eu/caldav.php$1
+        RedirectMatch 301 ^/davical(.*)$     https://dav.immae.eu/davical$1
+
+        RedirectMatch 301 ^/taskweb(.*)$     https://task.immae.eu/taskweb$1
+
+        RedirectMatch 301 ^/(.*)$            https://tools.immae.eu/$1
+        ''
+      ];
+    };
+
     services.myPhpfpm.poolConfigs = {
       adminer = adminer.phpFpm.pool;
       ttrss = ttrss.phpFpm.pool;
@@ -117,6 +144,22 @@ in {
       dokuwiki = dokuwiki.activationScript;
     };
 
+    system.extraSystemBuilderCmds = ''
+      mkdir -p $out/webapps
+      ln -s ${dokuwiki.webRoot} $out/webapps/${dokuwiki.apache.webappName}
+      ln -s ${ldap.webRoot}/htdocs $out/webapps/${ldap.apache.webappName}
+      ln -s ${rompr.webRoot} $out/webapps/${rompr.apache.webappName}
+      ln -s ${roundcubemail.webRoot} $out/webapps/${roundcubemail.apache.webappName}
+      ln -s ${shaarli.webRoot} $out/webapps/${shaarli.apache.webappName}
+      ln -s ${ttrss.webRoot} $out/webapps/${ttrss.apache.webappName}
+      ln -s ${wallabag.webRoot} $out/webapps/${wallabag.apache.webappName}
+      ln -s ${yourls.webRoot} $out/webapps/${yourls.apache.webappName}
+      '';
+
+    nixpkgs.config.packageOverrides = oldpkgs: rec {
+      ympd = oldpkgs.ympd.overrideAttrs(old: mylibs.fetchedGithub ./ympd.json);
+    };
+
     systemd.services.tt-rss = {
       description = "Tiny Tiny RSS feeds update daemon";
       serviceConfig = {