From 8cd2f72926293a8bca1b42fe7bccb2b9e61740d1 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 10 May 2022 15:17:55 +0200 Subject: Working cryptpad --- app/cryptpad/build/default.nix | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'app/cryptpad/build/default.nix') 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 <