buildMavenPackage: add overrideMavenAttrs function

This commit is contained in:
Thibault Gagnaux 2024-05-19 19:38:14 +02:00 committed by Thibault Gagnaux
parent fcdc4b9767
commit 9492bc8f7a
No known key found for this signature in database
GPG Key ID: 44BD0764ACAE8E25

View File

@ -6,7 +6,6 @@
makeWrapper, makeWrapper,
stdenvNoCC, stdenvNoCC,
}: }:
stdenvNoCC.mkDerivation (finalAttrs: { stdenvNoCC.mkDerivation (finalAttrs: {
pname = "maven"; pname = "maven";
version = "3.9.9"; version = "3.9.9";
@ -34,13 +33,30 @@ stdenvNoCC.mkDerivation (finalAttrs: {
runHook postInstall runHook postInstall
''; '';
passthru = { passthru =
let
makeOverridableMavenPackage =
mavenRecipe: mavenArgs:
let
drv = mavenRecipe mavenArgs;
overrideWith =
newArgs: mavenArgs // (if lib.isFunction newArgs then newArgs mavenArgs else newArgs);
in
drv
// {
overrideMavenAttrs = newArgs: makeOverridableMavenPackage mavenRecipe (overrideWith newArgs);
};
in
{
buildMaven = callPackage ./build-maven.nix { buildMaven = callPackage ./build-maven.nix {
maven = finalAttrs.finalPackage; maven = finalAttrs.finalPackage;
}; };
buildMavenPackage = callPackage ./build-maven-package.nix {
buildMavenPackage = makeOverridableMavenPackage (
callPackage ./build-maven-package.nix {
maven = finalAttrs.finalPackage; maven = finalAttrs.finalPackage;
}; }
);
}; };
meta = { meta = {