2022-10-21 18:38:19 +00:00
|
|
|
{ version, src, stdenv, lib, fetchFromGitHub, fetchYarnDeps, fixup_yarn_lock, yarn, nodejs }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
inherit version src;
|
|
|
|
|
|
|
|
pname = "rmfakecloud-webui";
|
|
|
|
|
|
|
|
yarnOfflineCache = fetchYarnDeps {
|
|
|
|
yarnLock = "${src}/ui/yarn.lock";
|
2023-04-29 16:46:19 +00:00
|
|
|
sha256 = "sha256-37P+acjaeG7TCyLoIHIHsB+DCUOsQOJ1H9T5SgajtLc=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ fixup_yarn_lock yarn nodejs ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
cd ui
|
|
|
|
fixup_yarn_lock yarn.lock
|
|
|
|
yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
|
|
|
|
yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
|
|
|
|
patchShebangs node_modules
|
|
|
|
export PATH=$PWD/node_modules/.bin:$PATH
|
|
|
|
./node_modules/.bin/react-scripts build
|
|
|
|
mkdir -p $out
|
|
|
|
cd ..
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
cp -r ui/build/* $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Only the webui files for rmfakecloud";
|
|
|
|
homepage = "https://ddvk.github.io/rmfakecloud/";
|
|
|
|
license = licenses.agpl3Only;
|
|
|
|
};
|
|
|
|
}
|