Skyler Grey | ec5ffff | 2023-03-26 10:44:35 +0000 | [diff] [blame^] | 1 | { fetchFromGitHub |
| 2 | , nodejs |
| 3 | , stdenv |
| 4 | , callPackage |
| 5 | , gnused |
| 6 | }: |
| 7 | let |
| 8 | nodeDependencies = (callPackage ./etherpad { }).nodeDependencies; |
| 9 | in |
| 10 | stdenv.mkDerivation rec { |
| 11 | pname = "etherpad"; |
| 12 | version = "1.8.18"; |
| 13 | |
| 14 | src = fetchFromGitHub { |
| 15 | owner = "ether"; |
| 16 | repo = "etherpad-lite"; |
| 17 | rev = version; |
| 18 | sha256 = "sha256-FziTdHmZ7DgWlSd7AhRdZioQNEPmiGZFHjc8pwnpKIo="; |
| 19 | }; |
| 20 | |
| 21 | buildInputs = [ |
| 22 | nodejs |
| 23 | ]; |
| 24 | |
| 25 | buildPhase = '' |
| 26 | ln -s ${nodeDependencies}/lib/node_modules ./src/node_modules |
| 27 | export PATH="${nodeDependencies}/bin:$PATH" |
| 28 | ''; |
| 29 | |
| 30 | installPhase = '' |
| 31 | mkdir $out |
| 32 | cp ./* $out -r |
| 33 | |
| 34 | mv $out/bin/fastRun.sh $out/bin/etherpad |
| 35 | sed -i "s#^cd .*#cd $out/#g" $out/bin/etherpad |
| 36 | chmod +x $out/bin/etherpad |
| 37 | ''; |
| 38 | } |