blob: 6bc70de3213f7545a59aabcdd88707ca792745cf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
{ lib
, stdenvNoCC
, version, src
, fetchYarnDeps
, prefetch-yarn-deps, yarn, nodejs
}:
stdenvNoCC.mkDerivation rec {
pname = "tilt-assets";
inherit src version;
nativeBuildInputs = [ prefetch-yarn-deps yarn nodejs ];
yarnOfflineCache = fetchYarnDeps {
yarnLock = "${src}/web/yarn.lock";
hash = "sha256-0JpoAQKRmU7P1bzYNR/vqtPjOOSw8wSlNjXl2f6uBrw=";
};
configurePhase = ''
export HOME=$(mktemp -d)/yarn_home
'';
buildPhase = ''
runHook preBuild
yarn config --offline set yarn-offline-mirror $yarnOfflineCache
cd web
fixup-yarn-lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-engines
patchShebangs node_modules
export PATH=$PWD/node_modules/.bin:$PATH
./node_modules/.bin/react-scripts build
mkdir -p $out
cd ..
runHook postBuild
'';
installPhase = ''
cp -r web/build/* $out
'';
meta = with lib; {
description = "Assets needed for Tilt";
homepage = "https://tilt.dev/";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ anton-dessiatov ];
platforms = platforms.all;
};
}
|