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.
 
 

46 lines
1021 B

with import <nixpkgs> {};
let
version = "0.1.1";
src = ./.;
nodePkg = pkgs.nodejs-14_x;
yarnPkg = pkgs.yarn.override { nodejs = nodePkg; };
in mkYarnPackage rec {
name = "gensokyo-auth-web";
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
mkdir -p ./dist/storybook
'';
buildPhase = ''
yarn build:server
'';
installPhase = ''
mkdir -p $out/server
cp -R ./dist/server/* $out/server/
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
'';
distPhase = ''
true
'';
nativeBuildInputs = with pkgs; [
nodePkg yarnPkg makeWrapper
automake autoconf m4 git bash
libpng libGL gcc yarn2nix
];
}