Files
nixpkgs/pkgs/development/python-modules/locust/webui.nix
2026-07-25 05:43:57 +01:00

46 lines
860 B
Nix

{
stdenv,
yarn-berry_4,
nodejs,
version,
src,
lib,
}:
let
yarn-berry = yarn-berry_4;
in
stdenv.mkDerivation (finalAttrs: {
pname = "locust-ui";
inherit version src;
patches = [
# Remove after upstream updates to Yarn 4.14
# https://github.com/locustio/locust/blob/master/locust/webui/package.json#L89
./yarn-4.14-support.patch
];
missingHashes = ./missing-hashes.json;
yarnOfflineCache = yarn-berry.fetchYarnBerryDeps {
inherit (finalAttrs) src missingHashes patches;
hash = "sha256-1pAoz/fkxrTCJZsSuAnm1Pfn5qjEbup8utEUoDvYJSE=";
};
nativeBuildInputs = [
yarn-berry
yarn-berry.yarnBerryConfigHook
nodejs
];
buildPhase = ''
runHook preBuild
yarn build
runHook postBuild
'';
dontNpmPrune = true;
postInstall = ''
mkdir -p $out/dist
cp -r dist/** $out/dist
'';
})