]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/tools/tools/dokuwiki.nix
Add config for CI
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / tools / dokuwiki.nix
index e40d671d9b506cd176d9f65776d54e747bd18682..aee495ac3fb3af170cc12d9bd5acf4d79be19452 100644 (file)
@@ -1,8 +1,5 @@
 { lib, stdenv, dokuwiki, dokuwiki-plugins }:
 rec {
-  backups = {
-    rootDir = varDir;
-  };
   varDir = "/var/lib/dokuwiki";
   activationScript = {
     deps = [ "wrappers" ];
@@ -19,19 +16,18 @@ rec {
       install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
     '';
   };
-  webRoot = dokuwiki.withPlugins (builtins.attrValues dokuwiki-plugins);
+  webRoot = dokuwiki.withPlugins (p: [ p.farmer p.todo ]);
   apache = rec {
     user = "wwwrun";
     group = "wwwrun";
     modules = [ "proxy_fcgi" ];
-    webappName = "tools_dokuwiki";
-    root = "/run/current-system/webapps/${webappName}";
-    vhostConf = ''
+    root = webRoot;
+    vhostConf = socket: ''
       Alias /dokuwiki "${root}"
       <Directory "${root}">
         DirectoryIndex index.php
         <FilesMatch "\.php$">
-          SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
+          SetHandler "proxy:unix:${socket}|fcgi://localhost"
         </FilesMatch>
 
         AllowOverride All
@@ -44,21 +40,17 @@ rec {
     serviceDeps = [ "openldap.service" ];
     basedir = builtins.concatStringsSep ":" (
       [ webRoot varDir ] ++ webRoot.plugins);
-    socket = "/var/run/phpfpm/dokuwiki.sock";
-    pool = ''
-      listen = ${socket}
-      user = ${apache.user}
-      group = ${apache.group}
-      listen.owner = ${apache.user}
-      listen.group = ${apache.group}
-      pm = ondemand
-      pm.max_children = 60
-      pm.process_idle_timeout = 60
+    pool = {
+      "listen.owner" = apache.user;
+      "listen.group" = apache.group;
+      "pm" = "ondemand";
+      "pm.max_children" = "60";
+      "pm.process_idle_timeout" = "60";
 
-      ; Needed to avoid clashes in browser cookies (same domain)
-      php_value[session.name] = DokuwikiPHPSESSID
-      php_admin_value[open_basedir] = "${basedir}:/tmp"
-      php_admin_value[session.save_path] = "${varDir}/phpSessions"
-      '';
+      # Needed to avoid clashes in browser cookies (same domain)
+      "php_value[session.name]" = "DokuwikiPHPSESSID";
+      "php_admin_value[open_basedir]" = "${basedir}:/tmp";
+      "php_admin_value[session.save_path]" = "${varDir}/phpSessions";
+    };
   };
 }