at 22.05-pre 529 B view raw
1{ stdenv, fetchurl }: 2{ version, artifactId, groupId, sha512, type ? "jar", suffix ? "" }: 3 4let 5 name = "${artifactId}-${version}"; 6 m2Path = "${builtins.replaceStrings ["."] ["/"] groupId}/${artifactId}/${version}"; 7 m2File = "${name}${suffix}.${type}"; 8 src = fetchurl { 9 inherit sha512; 10 url = "mirror://maven/${m2Path}/${m2File}"; 11 }; 12in stdenv.mkDerivation { 13 inherit name m2Path m2File src; 14 15 dontUnpack = true; 16 17 installPhase = '' 18 mkdir -p $out/m2/$m2Path 19 cp $src $out/m2/$m2Path/$m2File 20 ''; 21}