diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-05-10 15:17:55 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-05-10 15:18:07 +0200 |
commit | 8cd2f72926293a8bca1b42fe7bccb2b9e61740d1 (patch) | |
tree | b8242a66a6a3d9b09fe4a3a2896b5ab09aa20364 /app/cryptpad/build/default.nix | |
parent | 79e61b6bfd1585d1ce318d2805b321c218cf3791 (diff) | |
download | nixcfg-8cd2f72926293a8bca1b42fe7bccb2b9e61740d1.tar.gz nixcfg-8cd2f72926293a8bca1b42fe7bccb2b9e61740d1.zip |
Working cryptpad
Diffstat (limited to 'app/cryptpad/build/default.nix')
-rw-r--r-- | app/cryptpad/build/default.nix | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/app/cryptpad/build/default.nix b/app/cryptpad/build/default.nix index 7e31110..f0a5c00 100644 --- a/app/cryptpad/build/default.nix +++ b/app/cryptpad/build/default.nix @@ -39,30 +39,35 @@ in find node_modules -type f ! -path 'node_modules/gar/*' -executable -print | tee >(xargs -n 20 rm) # Remove only office that IS BIG - rm -rf www/common/onlyoffice + # COMMENTED as it is not as easy as planned. + # rm -rf www/common/onlyoffice ''; installPhase = '' mkdir -p $out/{bin,opt} + out_cryptpad=$out/opt/ + # copy the source code - cp -r .bowerrc bower.json package.json package-lock.json customize.dist lib server.js www $out/opt/ + cp -r .bowerrc bower.json package.json package-lock.json customize.dist lib server.js www $out_cryptpad # mount node_modules - cp -r node_modules $out/opt/node_modules + cp -r node_modules $out_cryptpad/node_modules + # patch + substituteInPlace $out_cryptpad/lib/workers/index.js --replace "lib/workers/db-worker" "$out_cryptpad/lib/workers/db-worker" # mount bower, based on the .bowerrc file at the git repo root - cp -r ${bower}/bower_components $out/opt/www/ + cp -r ${bower}/bower_components $out_cryptpad/www/ # cryptpad is bugged with absolute path, this is a workaround to use absolute path as relative path - ln -s / $out/opt/root + ln -s / $out_cryptpad/root - # start script + # start script, cryptpad is lost if its working directory is not its source directory cat > $out/bin/cryptpad <<EOF #!${pkgs.stdenv.shell} - cd $out/opt/ - ${nodejs}/bin/node server.js + cd $out_cryptpad + exec ${nodejs}/bin/node server.js EOF chmod +x $out/bin/cryptpad |