Status page for GenSoc
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

54 lines
1.1 KiB

  1. with import <nixpkgs> {};
  2. let
  3. name = "gensoc-status";
  4. version = "0.1.0";
  5. src = ./.;
  6. executableName = "gensoc-status";
  7. nodePkg = pkgs.nodejs-12_x;
  8. yarnPkg = pkgs.yarn.override { nodejs = nodePkg; };
  9. port = 8081;
  10. in mkYarnPackage {
  11. inherit name src version;
  12. system = builtins.currentSystem;
  13. packageJSON = "${src}/package.json";
  14. yarnLock = "${src}/yarn.lock";
  15. doDist = false;
  16. buildInputs = [
  17. automake autoconf m4 git bash
  18. nodejs-10_x libpng libGL gcc makeWrapper
  19. (yarn.override { nodejs = nodejs-10_x; })
  20. ];
  21. nativeBuildInputs = [
  22. makeWrapper
  23. ];
  24. configurePhase = ''
  25. rm -rf ./node_modules || true
  26. ln -s $node_modules ./node_modules
  27. export PATH=$PATH:$node_modules/.bin/
  28. export NODE_PATH=$NODE_PATH:$node_modules
  29. '';
  30. buildPhase = ''
  31. yarn build:server
  32. '';
  33. installPhase = ''
  34. mkdir $out
  35. cp -R dist/* $out/
  36. cp -R static $out/static
  37. cp -R src/config.json $out/config.json
  38. makeWrapper ${nodePkg}/bin/node $out/bin/${executableName} \
  39. --add-flags $out/server.js \
  40. --set NODE_PATH $NODE_PATH:$out:$node_modules \
  41. '';
  42. distPhase = ''
  43. true
  44. '';
  45. }