2019-10-11 20:43:04 +02:00
|
|
|
{ stdenv, lib, pkgs, python, nodejs_latest, fetchFromGitHub, fetchzip, fetchurl, conf }:
|
2019-08-11 16:25:29 +02:00
|
|
|
let
|
2019-10-11 20:43:04 +02:00
|
|
|
nodejs = nodejs_latest;
|
2019-08-11 16:25:29 +02:00
|
|
|
yarn2nix = import (fetchFromGitHub {
|
|
|
|
rev = "3f2dbb08724bf8841609f932bfe1d61a78277232";
|
|
|
|
owner = "moretea";
|
|
|
|
repo = "yarn2nix";
|
|
|
|
sha256 = "142av7dwviapsnahgj8r6779gs2zr17achzhr8b97s0hsl08dcl2";
|
|
|
|
}) { inherit pkgs nodejs; };
|
2019-08-11 16:46:15 +02:00
|
|
|
in
|
|
|
|
yarn2nix.mkYarnPackage {
|
|
|
|
name = "hopglass-frontend";
|
2019-08-11 16:25:29 +02:00
|
|
|
src = fetchFromGitHub {
|
2020-06-22 20:21:39 +02:00
|
|
|
rev = "a2c943115937b13a7ee11630572ebbe3fa28d80a";
|
2019-08-11 16:25:29 +02:00
|
|
|
owner = "hopglass";
|
|
|
|
repo = "hopglass";
|
2020-06-22 20:21:39 +02:00
|
|
|
sha256 = "0448kbibnf21p2w0rvbfnxd5f45nvi8lsv3rxyma4876cc4imwbv";
|
2019-08-11 16:25:29 +02:00
|
|
|
};
|
2019-08-11 16:46:15 +02:00
|
|
|
conf = conf;
|
2019-08-11 16:25:29 +02:00
|
|
|
installPhase = ''
|
|
|
|
echo ---------------------------------------------------------------------------- installPhase
|
|
|
|
set -x
|
|
|
|
#yarn --offline build
|
|
|
|
ls -l
|
|
|
|
cp -R $src/. .
|
|
|
|
node_modules/.bin/grunt --force
|
|
|
|
mkdir -p $out
|
|
|
|
set +x
|
|
|
|
'';
|
|
|
|
distPhase = ''
|
|
|
|
cp -Rv build/* $out/
|
2019-08-11 16:57:55 +02:00
|
|
|
cat "$conf" > $out/config.json
|
2019-08-11 16:25:29 +02:00
|
|
|
'';
|
|
|
|
allowedReferences = [ "out" ];
|
|
|
|
yarnPreBuild = ''
|
|
|
|
mkdir -p $HOME/.node-gyp/${nodejs.version}
|
|
|
|
echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion
|
|
|
|
ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version}
|
|
|
|
'';
|
|
|
|
# work around some purity problems in nix
|
|
|
|
#yarnLock = ./yarn.lock;
|
|
|
|
#packageJSON = ./package.json;
|
|
|
|
}
|