aboutsummaryrefslogtreecommitdiff
path: root/pkgs/webapps
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-07 00:01:09 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-07 00:01:09 +0200
commitc9d13ae319b4f01202a1afad046c3c1add1cc7ba (patch)
tree5552225ea95941d1273ce2b6e9e63884933f28ba /pkgs/webapps
parentf61d1c7cb908ab83cffe962cc73f1a86e692b6e5 (diff)
downloadNix-c9d13ae319b4f01202a1afad046c3c1add1cc7ba.tar.gz
Nix-c9d13ae319b4f01202a1afad046c3c1add1cc7ba.tar.zst
Nix-c9d13ae319b4f01202a1afad046c3c1add1cc7ba.zip
Move dokuwiki to pkgs
Diffstat (limited to 'pkgs/webapps')
-rw-r--r--pkgs/webapps/default.nix8
-rw-r--r--pkgs/webapps/dokuwiki/default.nix41
-rw-r--r--pkgs/webapps/dokuwiki/dokuwiki.json15
-rw-r--r--pkgs/webapps/dokuwiki/plugins/farmer.nix25
-rw-r--r--pkgs/webapps/dokuwiki/plugins/todo.nix18
5 files changed, 107 insertions, 0 deletions
diff --git a/pkgs/webapps/default.nix b/pkgs/webapps/default.nix
index 109eb6d..4403f5d 100644
--- a/pkgs/webapps/default.nix
+++ b/pkgs/webapps/default.nix
@@ -34,4 +34,12 @@ rec {
34 in 34 in
35 lib.attrsets.genAttrs names 35 lib.attrsets.genAttrs names
36 (name: callPackage (./mantisbt_2/plugins + "/${name}") {}); 36 (name: callPackage (./mantisbt_2/plugins + "/${name}") {});
37
38 dokuwiki = callPackage ./dokuwiki { inherit mylibs; };
39 dokuwiki-with-plugins = dokuwiki.withPlugins (builtins.attrValues dokuwiki-plugins);
40 dokuwiki-plugins = let
41 names = [ "farmer" "todo" ];
42 in
43 lib.attrsets.genAttrs names
44 (name: callPackage (./dokuwiki/plugins + "/${name}.nix") {});
37} 45}
diff --git a/pkgs/webapps/dokuwiki/default.nix b/pkgs/webapps/dokuwiki/default.nix
new file mode 100644
index 0000000..7b5d899
--- /dev/null
+++ b/pkgs/webapps/dokuwiki/default.nix
@@ -0,0 +1,41 @@
1{ varDir ? "/var/lib/dokuwiki", preload ? "", lib, stdenv, mylibs, writeText }:
2let
3 preloadFile = plugins: let preloads = [preload]
4 ++ builtins.concatMap (p: lib.optional (lib.hasAttr "preload" p) (p.preload p)) plugins;
5 in writeText "preload.php" (''
6 <?php
7 '' + builtins.concatStringsSep "\n" preloads
8 );
9 withPlugins = plugins: package.overrideAttrs(old: {
10 name = "${old.name}-with-plugins";
11 installPhase = old.installPhase + (
12 builtins.concatStringsSep "\n" (
13 map (value: "ln -sf ${value} $out/lib/plugins/${value.pluginName}") plugins
14 )
15 );
16 installPreloadPhase = ''
17 cp ${preloadFile plugins} $out/inc/preload.php
18 '';
19 passthru.plugins = plugins;
20 passthru.withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins);
21 });
22 package = stdenv.mkDerivation (mylibs.fetchedGithub ./dokuwiki.json // rec {
23 phases = "unpackPhase buildPhase installPhase installPreloadPhase fixupPhase";
24 buildPhase = ''
25 mv conf conf.dist
26 mv data data.dist
27 '';
28 installPhase = ''
29 cp -a . $out
30 ln -sf ${varDir}/{conf,data} $out/
31 ln -sf ${varDir}/conf/.htaccess $out/
32 '';
33 installPreloadPhase = ''
34 cp ${preloadFile []} $out/inc/preload.php
35 '';
36 passthru = {
37 plugins = [];
38 inherit withPlugins varDir;
39 };
40 });
41in package
diff --git a/pkgs/webapps/dokuwiki/dokuwiki.json b/pkgs/webapps/dokuwiki/dokuwiki.json
new file mode 100644
index 0000000..fc03252
--- /dev/null
+++ b/pkgs/webapps/dokuwiki/dokuwiki.json
@@ -0,0 +1,15 @@
1{
2 "tag": "release_stable_2018-04-22b",
3 "meta": {
4 "name": "dokuwiki",
5 "url": "https://github.com/splitbrain/dokuwiki",
6 "branch": "refs/tags/release_stable_2018-04-22b"
7 },
8 "github": {
9 "owner": "splitbrain",
10 "repo": "dokuwiki",
11 "rev": "871dae1320b40211626c7ec665f5e6d5290aca95",
12 "sha256": "1syvd5dvv3v75swf8ig7dxqs0g5xikb0f6vlcy7g4c4ghldkw7nz",
13 "fetchSubmodules": true
14 }
15}
diff --git a/pkgs/webapps/dokuwiki/plugins/farmer.nix b/pkgs/webapps/dokuwiki/plugins/farmer.nix
new file mode 100644
index 0000000..b737b2d
--- /dev/null
+++ b/pkgs/webapps/dokuwiki/plugins/farmer.nix
@@ -0,0 +1,25 @@
1{ stdenv, fetchFromGitHub }:
2stdenv.mkDerivation rec {
3 version = "72b8577-master";
4 name = "dokuwiki-plugin-farmer-${version}";
5 src = fetchFromGitHub {
6 owner = "cosmocode";
7 repo = "dokuwiki-plugin-farmer";
8 rev = "72b857734fd164bf79cc6e17abe56491d55c1072";
9 sha256 = "1c9vc1z7yvzjz4p054kshb9yd00a4bb52s43k9zav0lvwvjij9l0";
10 };
11 installPhase = ''
12 mkdir $out
13 cp -a * $out
14 '';
15 passthru = {
16 pluginName = "farmer";
17 preload = out: ''
18 # farm setup by farmer plugin
19 if (file_exists('${out}/DokuWikiFarmCore.php'))
20 {
21 include('${out}/DokuWikiFarmCore.php');
22 }
23 '';
24 };
25}
diff --git a/pkgs/webapps/dokuwiki/plugins/todo.nix b/pkgs/webapps/dokuwiki/plugins/todo.nix
new file mode 100644
index 0000000..a3e03fb
--- /dev/null
+++ b/pkgs/webapps/dokuwiki/plugins/todo.nix
@@ -0,0 +1,18 @@
1{ stdenv, fetchFromGitHub }:
2stdenv.mkDerivation rec {
3 version = "49068ec-master";
4 name = "dokuwiki-plugin-todo-${version}";
5 src = fetchFromGitHub {
6 owner = "leibler";
7 repo = "dokuwiki-plugin-todo";
8 rev = "49068ecea455ea997d1e4a7adab171ccaf8228e8";
9 sha256 = "1jaq623kp14fyhamsas5mk9ryqlk4q6x6znijrb5xhcdg3r83gmq";
10 };
11 installPhase = ''
12 mkdir $out
13 cp -a * $out
14 '';
15 passthru = {
16 pluginName = "todo";
17 };
18}