ratman.dashboard: use yarnConfigHook

This commit is contained in:
Yureka
2025-03-06 13:33:44 +01:00
committed by Yureka
parent a8ae11024b
commit 3058834efa
+5 -23
View File
@@ -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