From b892dcbeee4319885dc8371977046c9aabfed7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 8 Feb 2019 23:31:48 +0100 Subject: Add dokuwiki --- nixops/modules/websites/tools/tools/default.nix | 9 +- .../tools/tools/dokuwiki-plugin-farmer.json | 15 ++++ .../websites/tools/tools/dokuwiki-plugin-todo.json | 15 ++++ nixops/modules/websites/tools/tools/dokuwiki.json | 15 ++++ nixops/modules/websites/tools/tools/dokuwiki.nix | 99 ++++++++++++++++++++++ 5 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 nixops/modules/websites/tools/tools/dokuwiki-plugin-farmer.json create mode 100644 nixops/modules/websites/tools/tools/dokuwiki-plugin-todo.json create mode 100644 nixops/modules/websites/tools/tools/dokuwiki.json create mode 100644 nixops/modules/websites/tools/tools/dokuwiki.nix (limited to 'nixops/modules') diff --git a/nixops/modules/websites/tools/tools/default.nix b/nixops/modules/websites/tools/tools/default.nix index 41f47a3..0b50a7c 100644 --- a/nixops/modules/websites/tools/tools/default.nix +++ b/nixops/modules/websites/tools/tools/default.nix @@ -21,6 +21,9 @@ let shaarli = pkgs.callPackage ./shaarli.nix { env = myconfig.env.tools.shaarli; }; + dokuwiki = pkgs.callPackage ./dokuwiki.nix { + inherit (mylibs) fetchedGithub; + }; cfg = config.services.myWebsites.tools.tools; in { @@ -39,7 +42,8 @@ in { ++ wallabag.apache.modules ++ yourls.apache.modules ++ rompr.apache.modules - ++ shaarli.apache.modules; + ++ shaarli.apache.modules + ++ dokuwiki.apache.modules; services.ympd = ympd.config // { enable = true; }; @@ -56,6 +60,7 @@ in { yourls.apache.vhostConf rompr.apache.vhostConf shaarli.apache.vhostConf + dokuwiki.apache.vhostConf ]; }; @@ -67,6 +72,7 @@ in { yourls = yourls.phpFpm.pool; rompr = rompr.phpFpm.pool; shaarli = shaarli.phpFpm.pool; + dokuwiki = dokuwiki.phpFpm.pool; }; system.activationScripts = { @@ -76,6 +82,7 @@ in { yourls = yourls.activationScript; rompr = rompr.activationScript; shaarli = shaarli.activationScript; + dokuwiki = dokuwiki.activationScript; }; systemd.services.tt-rss = { diff --git a/nixops/modules/websites/tools/tools/dokuwiki-plugin-farmer.json b/nixops/modules/websites/tools/tools/dokuwiki-plugin-farmer.json new file mode 100644 index 0000000..4022eb4 --- /dev/null +++ b/nixops/modules/websites/tools/tools/dokuwiki-plugin-farmer.json @@ -0,0 +1,15 @@ +{ + "tag": "72b8577-master", + "meta": { + "name": "dokuwiki-plugin-farmer", + "url": "https://github.com/cosmocode/dokuwiki-plugin-farmer", + "branch": "master" + }, + "github": { + "owner": "cosmocode", + "repo": "dokuwiki-plugin-farmer", + "rev": "72b857734fd164bf79cc6e17abe56491d55c1072", + "sha256": "1c9vc1z7yvzjz4p054kshb9yd00a4bb52s43k9zav0lvwvjij9l0", + "fetchSubmodules": true + } +} diff --git a/nixops/modules/websites/tools/tools/dokuwiki-plugin-todo.json b/nixops/modules/websites/tools/tools/dokuwiki-plugin-todo.json new file mode 100644 index 0000000..9576826 --- /dev/null +++ b/nixops/modules/websites/tools/tools/dokuwiki-plugin-todo.json @@ -0,0 +1,15 @@ +{ + "tag": "49068ec-master", + "meta": { + "name": "dokuwiki-plugin-todo", + "url": "https://github.com/leibler/dokuwiki-plugin-todo", + "branch": "master" + }, + "github": { + "owner": "leibler", + "repo": "dokuwiki-plugin-todo", + "rev": "49068ecea455ea997d1e4a7adab171ccaf8228e8", + "sha256": "1jaq623kp14fyhamsas5mk9ryqlk4q6x6znijrb5xhcdg3r83gmq", + "fetchSubmodules": true + } +} diff --git a/nixops/modules/websites/tools/tools/dokuwiki.json b/nixops/modules/websites/tools/tools/dokuwiki.json new file mode 100644 index 0000000..fc03252 --- /dev/null +++ b/nixops/modules/websites/tools/tools/dokuwiki.json @@ -0,0 +1,15 @@ +{ + "tag": "release_stable_2018-04-22b", + "meta": { + "name": "dokuwiki", + "url": "https://github.com/splitbrain/dokuwiki", + "branch": "refs/tags/release_stable_2018-04-22b" + }, + "github": { + "owner": "splitbrain", + "repo": "dokuwiki", + "rev": "871dae1320b40211626c7ec665f5e6d5290aca95", + "sha256": "1syvd5dvv3v75swf8ig7dxqs0g5xikb0f6vlcy7g4c4ghldkw7nz", + "fetchSubmodules": true + } +} diff --git a/nixops/modules/websites/tools/tools/dokuwiki.nix b/nixops/modules/websites/tools/tools/dokuwiki.nix new file mode 100644 index 0000000..5affddb --- /dev/null +++ b/nixops/modules/websites/tools/tools/dokuwiki.nix @@ -0,0 +1,99 @@ +{ lib, php, stdenv, writeText, fetchedGithub }: +let + dokuwiki = let + plugins = { + farmer = stdenv.mkDerivation (fetchedGithub ./dokuwiki-plugin-farmer.json // rec { + installPhase = '' + mkdir $out + cp -a * $out/ + ''; + }); + todo = stdenv.mkDerivation (fetchedGithub ./dokuwiki-plugin-todo.json // rec { + installPhase = '' + mkdir $out + cp -a * $out/ + ''; + }); + }; + preload = writeText "preload.php" '' + + DirectoryIndex index.php + + SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" + + + AllowOverride All + Options +FollowSymlinks + Require all granted + + ''; + }; + phpFpm = rec { + basedir = builtins.concatStringsSep ":" ( + [ webRoot varDir ] + ++ lib.attrsets.mapAttrsToList (name: value: value) 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 + + ; 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" + ''; + }; + }; +in + dokuwiki -- cgit v1.2.3