check if vendorHash is up to date

This commit is contained in:
Robin Appelman 2025-10-26 02:07:03 +02:00
commit 293329e37b
2 changed files with 39 additions and 6 deletions

28
checks/vendor-hash.nix Normal file
View file

@ -0,0 +1,28 @@
{
composerMeta,
src,
vendor,
stdenvNoCC,
}: let
inherit (composerMeta) version name;
in
stdenvNoCC.mkDerivation {
inherit src version;
pname = "${name}-check-vendor-hash";
postPatch = ''
ln -s ${vendor}/vendor vendor
'';
buildPhase = ''
runHook preBuild
diff -q ${vendor}/composer.lock composer.lock || (echo "vendorHash is out of date" && exit 1)
runHook postBuild
'';
installPhase = ''
touch $out
'';
}