1 { varDir ? "/var/lib/etherpad-lite" # if you override this change the StateDirectory in service file too!
2 , stdenv, callPackage, mylibs, fetchurl }:
5 url = https://code.jquery.com/jquery-1.9.1.js;
6 sha256 = "0h4dk67yc9d0kadqxb6b33585f3x3559p6qmp70l00qwq030vn3v";
8 withModules = modules: package.overrideAttrs(old: {
13 if [ ! -f $out/lib/node_modules/${n.moduleName}/.ep_initialized ]; then
14 ln -s ${varDir}/ep_initialized/${n.moduleName} $out/lib/node_modules/${n.moduleName}/.ep_initialized
18 in "cp -a ${n'}/lib/node_modules/${n.moduleName} $out/node_modules";
19 in old.installPhase + builtins.concatStringsSep "\n" (map modInst modules);
20 passthru = old.passthru // {
22 withModules = moreModules: old.withModules (moreModules ++ modules);
25 # built using node2nix -l package-lock.json
26 # and changing "./." to "src"
27 node-environment = (callPackage ./node-packages.nix {
28 nodeEnv = callPackage mylibs.nodeEnv {};
29 src = stdenv.mkDerivation (mylibs.fetchedGithub ./etherpad-lite.json // rec {
30 patches = [ ./libreoffice_patch.diff ];
32 touch src/.ep_initialized
33 cp -v src/static/custom/js.template src/static/custom/index.js
34 cp -v src/static/custom/js.template src/static/custom/pad.js
35 cp -v src/static/custom/js.template src/static/custom/timeslider.js
36 cp -v src/static/custom/css.template src/static/custom/index.css
37 cp -v src/static/custom/css.template src/static/custom/pad.css
38 cp -v src/static/custom/css.template src/static/custom/timeslider.css
45 package = stdenv.mkDerivation rec {
46 name = (mylibs.fetchedGithub ./etherpad-lite.json).name;
47 src = node-environment;
50 mkdir $out/node_modules
51 cp -a lib/node_modules/ep_etherpad-lite $out/src
52 chmod u+w $out/src/static/js/
53 cp ${jquery} $out/src/static/js/jquery.js
54 ln -s ../src $out/node_modules/ep_etherpad-lite
58 inherit varDir withModules;