hopglass: test if hopglass works on nixos
This commit is contained in:
parent
7b806690a8
commit
c006338aec
4 changed files with 129 additions and 0 deletions
44
pkg-hopglass-fe.nix
Normal file
44
pkg-hopglass-fe.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{ stdenv, lib, pkgs, python, nodejs-11_x, fetchFromGitHub, fetchzip, fetchurl, conf }:
|
||||
let
|
||||
nodejs = nodejs-11_x;
|
||||
yarn2nix = import (fetchFromGitHub {
|
||||
rev = "3f2dbb08724bf8841609f932bfe1d61a78277232";
|
||||
owner = "moretea";
|
||||
repo = "yarn2nix";
|
||||
sha256 = "142av7dwviapsnahgj8r6779gs2zr17achzhr8b97s0hsl08dcl2";
|
||||
}) { inherit pkgs nodejs; };
|
||||
origPackage = builtins.fromJSON (builtins.readFile ./package.json);
|
||||
src = fetchFromGitHub {
|
||||
rev = "fc09b591dc2b9dd867559ea008f1177d52a824dd";
|
||||
owner = "hopglass";
|
||||
repo = "hopglass";
|
||||
sha256 = "0s9x466jqn7swbd35kjiaqk2lmcy9fnykhcnb1b10a2l35q655cl";
|
||||
};
|
||||
in
|
||||
yarn2nix.mkYarnPackage {
|
||||
name = "hopglass-frontend";
|
||||
src = src;
|
||||
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/
|
||||
ln -s "$conf" $out/config.json
|
||||
'';
|
||||
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue