From f8163822d8ff93b0a961303713a6ae3d003bda48 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Tue, 20 May 2025 11:18:36 +0900 Subject: [PATCH 1/2] cryptpad: use full path for ln in wrapper script This allows running cryptpad even if coreutils is not in PATH Fixes: #408753 --- pkgs/by-name/cr/cryptpad/package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/cr/cryptpad/package.nix b/pkgs/by-name/cr/cryptpad/package.nix index 94087f88b86b..59dc4bd28008 100644 --- a/pkgs/by-name/cr/cryptpad/package.nix +++ b/pkgs/by-name/cr/cryptpad/package.nix @@ -1,6 +1,7 @@ { bash, buildNpmPackage, + coreutils, fetchFromGitHub, fetchpatch, fetchurl, @@ -147,7 +148,7 @@ buildNpmPackage { # directory. makeWrapper "${lib.getExe nodejs}" "$out/bin/cryptpad" \ --add-flags "$out_cryptpad/server.js" \ - --run "for d in customize.dist lib www; do ln -sf \"$out_cryptpad/\$d\" .; done" \ + --run "for d in customize.dist lib www; do ${coreutils}/bin/ln -sf \"$out_cryptpad/\$d\" .; done" \ --run "if ! [ -d customize ]; then \"${lib.getExe nodejs}\" \"$out_cryptpad/scripts/build.js\"; fi" ''; From 25363b9ab177e219fb16e7a3545b120e6b66285c Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Tue, 20 May 2025 11:13:29 +0900 Subject: [PATCH 2/2] cryptpad: 2024.12.0 -> 2025.3.0 On update cryptpad tries to run a migration script from run dir as ./scripts... so add a link for scripts as well Fixes: #404114 --- pkgs/by-name/cr/cryptpad/package.nix | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/cr/cryptpad/package.nix b/pkgs/by-name/cr/cryptpad/package.nix index 59dc4bd28008..804ff3c72a29 100644 --- a/pkgs/by-name/cr/cryptpad/package.nix +++ b/pkgs/by-name/cr/cryptpad/package.nix @@ -14,7 +14,7 @@ }: let - version = "2024.12.0"; + version = "2025.3.0"; # nix version of install-onlyoffice.sh # a later version could rebuild from sdkjs/web-apps as per # https://github.com/cryptpad/onlyoffice-builds/blob/main/build.sh @@ -84,10 +84,10 @@ buildNpmPackage { owner = "cryptpad"; repo = "cryptpad"; rev = version; - hash = "sha256-oSrDajaCEc7I2AsDzKoO34ffd4OeXDwFDGm45yQDSvE="; + hash = "sha256-NxkVMsfLzdzifdn+f0C6mBJGd1oLwcMTAIXv+gBG7rI="; }; - npmDepsHash = "sha256-1EwxAe+8FOrngZx5+FEeu9uHKWZNBpsECEGrsyiZ2GU="; + npmDepsHash = "sha256-GWkyRlizPSA72WwoY+mRLwaMeD/SXdo6oUVwsd2gp7c="; nativeBuildInputs = [ makeBinaryWrapper @@ -100,12 +100,6 @@ buildNpmPackage { # fix httpSafePort setting # https://github.com/cryptpad/cryptpad/pull/1571 ./0001-env.js-fix-httpSafePort-handling.patch - # https://github.com/cryptpad/cryptpad/pull/1740 - (fetchpatch { - name = "Add `--check`, `--rdfind`, `--no-rdfind` options to `install-onlyoffice.sh`"; - url = "https://github.com/cryptpad/cryptpad/commit/f38668735e777895db2eadd3413cff386fb12c0c.patch"; - hash = "sha256-J4AK1XIa3q+/lD74p2c9O7jt0VEtofTmfAaQNU71sp8="; - }) ]; # cryptpad build tries to write in cache dir @@ -148,7 +142,7 @@ buildNpmPackage { # directory. makeWrapper "${lib.getExe nodejs}" "$out/bin/cryptpad" \ --add-flags "$out_cryptpad/server.js" \ - --run "for d in customize.dist lib www; do ${coreutils}/bin/ln -sf \"$out_cryptpad/\$d\" .; done" \ + --run "for d in customize.dist lib www scripts; do ${coreutils}/bin/ln -sf \"$out_cryptpad/\$d\" .; done" \ --run "if ! [ -d customize ]; then \"${lib.getExe nodejs}\" \"$out_cryptpad/scripts/build.js\"; fi" '';