{ lib, stdenv, dokuwiki, dokuwiki-plugins }: rec { backups = { rootDir = varDir; remotes = [ "eriomem" "ovh" ]; }; varDir = "/var/lib/dokuwiki"; activationScript = { deps = [ "wrappers" ]; text = '' if [ ! -d ${varDir} ]; then install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \ ${varDir}/animals cp -a ${webRoot}/conf.dist ${varDir}/conf cp -a ${webRoot}/data.dist ${varDir}/data cp -a ${webRoot}/ chown -R ${apache.user}:${apache.user} ${varDir}/config ${varDir}/data chmod -R 755 ${varDir}/config ${varDir}/data fi install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions ''; }; webRoot = dokuwiki.withPlugins (p: [ p.farmer p.todo ]); apache = rec { user = "wwwrun"; group = "wwwrun"; modules = [ "proxy_fcgi" ]; root = webRoot; vhostConf = socket: '' Alias /dokuwiki "${root}" DirectoryIndex index.php SetHandler "proxy:unix:${socket}|fcgi://localhost" AllowOverride All Options +FollowSymlinks Require all granted ''; }; phpFpm = rec { serviceDeps = [ "openldap.service" ]; basedir = builtins.concatStringsSep ":" ( [ webRoot varDir ] ++ webRoot.plugins); 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"; }; }; }