aboutsummaryrefslogblamecommitdiff
path: root/app/cryptpad/build/default.nix
blob: 2069a5887ce68cc3b2b74403c0e824846c5bca09 (plain) (tree)


























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