ratman.dashboard: use yarnConfigHook
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
protobuf,
|
||||
rustPlatform,
|
||||
fetchYarnDeps,
|
||||
fixup-yarn-lock,
|
||||
yarnConfigHook,
|
||||
yarnBuildHook,
|
||||
stdenv,
|
||||
yarn,
|
||||
nodejs_20,
|
||||
}:
|
||||
|
||||
@@ -54,15 +54,15 @@ rustPlatform.buildRustPackage rec {
|
||||
inherit version src;
|
||||
sourceRoot = "${src.name}/ratman/dashboard";
|
||||
|
||||
yarnDeps = fetchYarnDeps {
|
||||
yarnOfflineCache = fetchYarnDeps {
|
||||
yarnLock = src + "/ratman/dashboard/yarn.lock";
|
||||
sha256 = "sha256-pWjKL41r/bTvWv+5qCgCFVL9+o64BiV2/ISdLeKEOqE=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
yarn
|
||||
nodejs_20
|
||||
fixup-yarn-lock
|
||||
yarnConfigHook
|
||||
yarnBuildHook
|
||||
];
|
||||
|
||||
outputs = [
|
||||
@@ -70,24 +70,6 @@ rustPlatform.buildRustPackage rec {
|
||||
"dist"
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
# Yarn writes temporary files to $HOME. Copied from mkYarnModules.
|
||||
export HOME=$NIX_BUILD_TOP/yarn_home
|
||||
|
||||
# Make yarn install packages from our offline cache, not the registry
|
||||
yarn config --offline set yarn-offline-mirror ${yarnDeps}
|
||||
|
||||
# Fixup "resolved"-entries in yarn.lock to match our offline cache
|
||||
fixup-yarn-lock yarn.lock
|
||||
|
||||
yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive
|
||||
|
||||
patchShebangs node_modules/
|
||||
|
||||
# Build into `./dist/`, suppress formatting.
|
||||
yarn --offline build | cat
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cp -R . $out
|
||||
|
||||
|
||||
Reference in New Issue
Block a user