Frontend for Miracle TV
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.
 
 
 
 

56 lines
1.4 KiB

  1. with import <nixpkgs> {};
  2. let
  3. artifactName = "miracle-tv-frontend";
  4. version = "0.1.0";
  5. src = ./.;
  6. nodePkg = pkgs.nodejs-14_x;
  7. yarnPkg = pkgs.yarn.override { nodejs = nodePkg; };
  8. vueCliPkg = pkgs.nodePackages."@vue/cli".override { nodejs = nodePkg; };
  9. in mkYarnPackage rec {
  10. name = "miarcle-tv-frontend";
  11. inherit version src nodePkg yarnPkg;
  12. packageJSON = "${src}/package.json";
  13. yarnLock = "${src}/yarn.lock";
  14. yarnNix = "${src}/yarn.nix";
  15. shellHook = ''
  16. rm -rf ./node_modules || true
  17. export PATH="$PATH:$node_modules/.bin"
  18. export NODE_PATH=$NODE_PATH:$node_modules
  19. ln -s $node_modules ./node_modules
  20. '';
  21. configurePhase = ''
  22. rm -rf ./node_modules || true
  23. export PATH=$PATH:$node_modules/.bin
  24. export NODE_PATH=$NODE_PATH:$node_modules
  25. ln -s $node_modules ./node_modules
  26. '';
  27. buildPhase = ''
  28. ${yarnPkg}/bin/yarn --offline build
  29. '';
  30. installPhase = ''
  31. mkdir -p $out/dist
  32. cp -R ./dist/* $out/dist/
  33. chmod 755 $out
  34. find $out/**/* -type d -print0|xargs -0 chmod 755
  35. find $out/**/* -type f -print0|xargs -0 chmod 644
  36. '';
  37. distPhase = ''
  38. mkdir -p $out/tarballs
  39. tar -czvf $out/tarballs/${artifactName}.${version}.tar.gz $out/dist/*
  40. '';
  41. nativeBuildInputs = with pkgs; [
  42. nodePkg yarnPkg vueCliPkg
  43. makeWrapper yarn2nix
  44. automake autoconf m4 git bash
  45. libpng libGL gcc
  46. ];
  47. }