Free and Open-source video streaming suite. https://miracle-tv.live
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.
 
 

58 lines
1.4 KiB

with import <nixpkgs> {};
let
version = "0.1.4";
src = ./.;
nodePkg = pkgs.nodejs-14_x;
yarnPkg = pkgs.yarn.override { nodejs = nodePkg; };
in mkYarnPackage rec {
name = "miracle-tv";
inherit version src nodePkg yarnPkg;
doDist = false;
packageJSON = "${src}/package.json";
yarnLock = "${src}/yarn.lock";
configurePhase = ''
rm -rf ./node_modules
mkdir ./node_modules
cp -R $node_modules/* ./node_modules
cp -R $node_modules/.bin ./node_modules
'';
buildPhase = ''
yarn build:server
yarn build:client
'';
installPhase = ''
mkdir -p $out/server
cp -R ./dist/server/* $out/server/
mkdir -p $out/server/graphql
cp -R src/server/graphql/schema/* $out/server/graphql/
makeWrapper ${nodePkg}/bin/node $out/bin/server \
--add-flags "$out/server/index.js" \
--set node_modules $node_modules \
--set NODE_PATH $NODE_PATH:$node_modules
mkdir -p $out/client/dist
cp -R ./next-production.config.js $out/client/next.config.js
cp -R ./dist/client/* $out/client/dist
makeWrapper $node_modules/.bin/next $out/bin/client \
--add-flags "start" \
--add-flags "$out/client" \
--set node_modules $node_modules \
--set NODE_PATH $NODE_PATH:$node_modules
'';
distPhase = ''
true
'';
nativeBuildInputs = with pkgs; [
nodePkg yarnPkg makeWrapper
automake autoconf m4 git bash
libpng libGL gcc yarn2nix
];
}