diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/impure/etherpad-lite/default.nix | 69 | ||||
-rw-r--r-- | pkgs/impure/etherpad-lite/etherpad-lite.json | 15 | ||||
-rw-r--r-- | pkgs/impure/etherpad-lite/libreoffice_patch.diff | 11 | ||||
-rw-r--r-- | pkgs/webapps/default.nix | 26 |
4 files changed, 121 insertions, 0 deletions
diff --git a/pkgs/impure/etherpad-lite/default.nix b/pkgs/impure/etherpad-lite/default.nix new file mode 100644 index 0000000..c85bd7e --- /dev/null +++ b/pkgs/impure/etherpad-lite/default.nix | |||
@@ -0,0 +1,69 @@ | |||
1 | { session_key ? "/etc/etherpad-lite/SESSIONKEY.txt" | ||
2 | , api_key ? "/etc/etherpad-lite/APIKEY.txt" | ||
3 | , stdenv, mylibs, cacert, nodejs, python, fetchurl }: | ||
4 | let | ||
5 | jquery = fetchurl { | ||
6 | url = https://code.jquery.com/jquery-1.9.1.js; | ||
7 | sha256 = "0h4dk67yc9d0kadqxb6b33585f3x3559p6qmp70l00qwq030vn3v"; | ||
8 | }; | ||
9 | withModules = modules: package.overrideAttrs(old: { | ||
10 | buildPhase = old.buildPhase + | ||
11 | builtins.concatStringsSep "\n" | ||
12 | (map (n: "npm install ${n}; touch node_modules/${n}/.ep_initialized") modules); | ||
13 | # FIXME: ln -s don’t seem to work, etherpad seems | ||
14 | # unable to "touch" them after initialization | ||
15 | passthru = old.passthru // { | ||
16 | inherit modules; | ||
17 | withModules = moreModules: old.withModules (moreModules ++ modules); | ||
18 | }; | ||
19 | }); | ||
20 | package = stdenv.mkDerivation (mylibs.fetchedGithub ./etherpad-lite.json // rec { | ||
21 | __noChroot = true; | ||
22 | patches = [ ./libreoffice_patch.diff ]; | ||
23 | buildPhase = '' | ||
24 | export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt | ||
25 | export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt | ||
26 | export HOME=$PWD | ||
27 | |||
28 | touch src/.ep_initialized | ||
29 | cp -v src/static/custom/js.template src/static/custom/index.js | ||
30 | cp -v src/static/custom/js.template src/static/custom/pad.js | ||
31 | cp -v src/static/custom/js.template src/static/custom/timeslider.js | ||
32 | cp -v src/static/custom/css.template src/static/custom/index.css | ||
33 | cp -v src/static/custom/css.template src/static/custom/pad.css | ||
34 | cp -v src/static/custom/css.template src/static/custom/timeslider.css | ||
35 | |||
36 | sed -i 's/var\/dirty.db/\/var\/lib\/etherpad-lite\/dirty.db/g' \ | ||
37 | settings.json.template | ||
38 | |||
39 | mkdir -v node_modules | ||
40 | ln -s ../src node_modules/ep_etherpad-lite | ||
41 | |||
42 | node bin/doc/generate doc/index.md --format=html \ | ||
43 | --template=doc/template.html > documentation.html | ||
44 | |||
45 | cd src | ||
46 | npm install | ||
47 | cd .. | ||
48 | ''; | ||
49 | installPhase = '' | ||
50 | mkdir -p $out | ||
51 | install -t $out/src/ -vDm 644 src/.ep_initialized | ||
52 | cp -a node_modules $out/ | ||
53 | cp -a src/* $out/src/ | ||
54 | ln -sf ${session_key} $out/SESSIONKEY.txt | ||
55 | ln -sf ${api_key} $out/APIKEY.txt | ||
56 | cp ${jquery} $out/src/static/js/jquery.js | ||
57 | |||
58 | mkdir $out/doc | ||
59 | install -t "$out/doc/" \ | ||
60 | -vDm 644 {CHANGELOG,CONTRIBUTING,README}.md \ | ||
61 | -vDm 644 documentation.html | ||
62 | ''; | ||
63 | buildInputs = [ nodejs python ]; | ||
64 | passthru = { | ||
65 | modules = []; | ||
66 | inherit withModules; | ||
67 | }; | ||
68 | }); | ||
69 | in package | ||
diff --git a/pkgs/impure/etherpad-lite/etherpad-lite.json b/pkgs/impure/etherpad-lite/etherpad-lite.json new file mode 100644 index 0000000..81369c4 --- /dev/null +++ b/pkgs/impure/etherpad-lite/etherpad-lite.json | |||
@@ -0,0 +1,15 @@ | |||
1 | { | ||
2 | "tag": "1.7.0", | ||
3 | "meta": { | ||
4 | "name": "etherpad-lite", | ||
5 | "url": "https://github.com/ether/etherpad-lite", | ||
6 | "branch": "refs/tags/1.7.0" | ||
7 | }, | ||
8 | "github": { | ||
9 | "owner": "ether", | ||
10 | "repo": "etherpad-lite", | ||
11 | "rev": "96ac381afb9ea731dad48968f15d77dc6488bd0d", | ||
12 | "sha256": "03k6bwlm9ch9kssy9jipfg8ij7rpbzd89xq4mvg4grg1q6ivnzk9", | ||
13 | "fetchSubmodules": true | ||
14 | } | ||
15 | } | ||
diff --git a/pkgs/impure/etherpad-lite/libreoffice_patch.diff b/pkgs/impure/etherpad-lite/libreoffice_patch.diff new file mode 100644 index 0000000..d9e3dfc --- /dev/null +++ b/pkgs/impure/etherpad-lite/libreoffice_patch.diff | |||
@@ -0,0 +1,11 @@ | |||
1 | --- a/src/node/utils/LibreOffice.js 2018-06-18 09:54:15.087161212 +0200 | ||
2 | +++ b/src/node/utils/LibreOffice.js 2018-06-18 10:33:27.534055021 +0200 | ||
3 | @@ -63,6 +63,7 @@ | ||
4 | '--invisible', | ||
5 | '--nologo', | ||
6 | '--nolockcheck', | ||
7 | + '-env:UserInstallation=file:///tmp/', | ||
8 | '--convert-to', task.type, | ||
9 | task.srcFile, | ||
10 | '--outdir', tmpDir | ||
11 | |||
diff --git a/pkgs/webapps/default.nix b/pkgs/webapps/default.nix index 8fbb20f..a771aee 100644 --- a/pkgs/webapps/default.nix +++ b/pkgs/webapps/default.nix | |||
@@ -13,6 +13,32 @@ rec { | |||
13 | lib.attrsets.genAttrs names | 13 | lib.attrsets.genAttrs names |
14 | (name: callPackage (./dokuwiki/plugins + "/${name}.nix") {}); | 14 | (name: callPackage (./dokuwiki/plugins + "/${name}.nix") {}); |
15 | 15 | ||
16 | etherpad-lite = callPackage ../impure/etherpad-lite {}; | ||
17 | etherpad-lite-with-modules = etherpad-lite.withModules etherpad-lite-modules; | ||
18 | etherpad-lite-modules = [ | ||
19 | "ep_aa_file_menu_toolbar" | ||
20 | "ep_adminpads" | ||
21 | "ep_align" | ||
22 | "ep_bookmark" | ||
23 | "ep_clear_formatting" | ||
24 | "ep_colors" | ||
25 | "ep_copy_paste_select_all" | ||
26 | "ep_cursortrace" | ||
27 | "ep_embedmedia" | ||
28 | "ep_font_family" | ||
29 | "ep_font_size" | ||
30 | "ep_headings2" | ||
31 | "ep_ldapauth" | ||
32 | "ep_line_height" | ||
33 | "ep_markdown" | ||
34 | "ep_previewimages" | ||
35 | "ep_ruler" | ||
36 | "ep_scrollto" | ||
37 | "ep_set_title_on_pad" | ||
38 | "ep_subscript_and_superscript" | ||
39 | "ep_timesliderdiff" | ||
40 | ]; | ||
41 | |||
16 | infcloud = callPackage ./infcloud {}; | 42 | infcloud = callPackage ./infcloud {}; |
17 | 43 | ||
18 | mantisbt_2 = callPackage ./mantisbt_2 {}; | 44 | mantisbt_2 = callPackage ./mantisbt_2 {}; |