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 {
++ wallabag.apache.modules
++ yourls.apache.modules
++ rompr.apache.modules
- ++ shaarli.apache.modules;
+ ++ shaarli.apache.modules
+ ++ dokuwiki.apache.modules;
services.ympd = ympd.config // { enable = true; };
yourls.apache.vhostConf
rompr.apache.vhostConf
shaarli.apache.vhostConf
+ dokuwiki.apache.vhostConf
];
};
yourls = yourls.phpFpm.pool;
rompr = rompr.phpFpm.pool;
shaarli = shaarli.phpFpm.pool;
+ dokuwiki = dokuwiki.phpFpm.pool;
};
system.activationScripts = {
yourls = yourls.activationScript;
rompr = rompr.activationScript;
shaarli = shaarli.activationScript;
+ dokuwiki = dokuwiki.activationScript;
};
systemd.services.tt-rss = {
--- /dev/null
+{
+ "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
+ }
+}
--- /dev/null
+{
+ "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
+ }
+}
--- /dev/null
+{
+ "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
+ }
+}
--- /dev/null
+{ 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" ''
+ <?php
+ # farm setup by farmer plugin
+ if(file_exists('${plugins.farmer}/DokuWikiFarmCore.php'))
+ {
+ include('${plugins.farmer}/DokuWikiFarmCore.php');
+ }
+ '';
+ in rec {
+ 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 = stdenv.mkDerivation (fetchedGithub ./dokuwiki.json // rec {
+ buildPhase = ''
+ mv conf conf.dist
+ mv data data.dist
+ '';
+ installPhase = ''
+ cp -a . $out
+ cp ${preload} $out/inc/preload.php
+ ln -sf ../../../../../${varDir}/{conf,data} $out/
+ ln -sf ../../../../../${varDir}/conf/.htaccess $out/
+ ${builtins.concatStringsSep "\n" (
+ lib.attrsets.mapAttrsToList (name: value: "ln -sf ${value} $out/lib/plugins/${name}") plugins
+ )}
+ '';
+ });
+ apache = {
+ user = "wwwrun";
+ group = "wwwrun";
+ modules = [ "proxy_fcgi" ];
+ vhostConf = ''
+ Alias /dokuwiki "${webRoot}"
+ <Directory "${webRoot}">
+ DirectoryIndex index.php
+ <FilesMatch "\.php$">
+ SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
+ </FilesMatch>
+
+ AllowOverride All
+ Options +FollowSymlinks
+ Require all granted
+ </Directory>
+ '';
+ };
+ 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