infrastructure/app/cryptpad/build/default.nix

27 lines
571 B
Nix

let
common = import ./common.nix;
pkgs = import common.pkgsSrc {};
nodejs = pkgs.${common.nodejs};
in
pkgs.stdenv.mkDerivation {
name = "cryptpad";
src = ./cryptpad;
installPhase = ''
mkdir -p $out/{bin,opt}
cp -r config customize.dist lib node_modules package.json package-lock.json server.js www $out/opt/
ln -s / $out/opt/root
cat > $out/bin/cryptpad <<EOF
cd $out/opt/
#!${pkgs.bash}/bin/bash
${nodejs}/bin/node server.js
EOF
chmod +x $out/bin/cryptpad
'';
dontFixup = true;
}