This repository has been archived on 2023-03-15. You can view files and clone it, but cannot push or open issues or pull requests.
infrastructure/app/cryptpad/build/default.nix
2022-05-05 17:45:15 +02:00

28 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;
}