mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 13:41:26 +00:00
22 lines
535 B
Nix
22 lines
535 B
Nix
{ stdenv, fetchurl }:
|
|
{ version, artifactId, groupId, sha512, type ? "jar", suffix ? "" }:
|
|
|
|
let
|
|
name = "${artifactId}-${version}";
|
|
m2Path = "${builtins.replaceStrings ["."] ["/"] groupId}/${artifactId}/${version}";
|
|
m2File = "${name}${suffix}.${type}";
|
|
src = fetchurl {
|
|
inherit sha512;
|
|
url = "mirror://maven/${m2Path}/${m2File}";
|
|
};
|
|
in stdenv.mkDerivation {
|
|
inherit name m2Path m2File src;
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/m2/$m2Path
|
|
cp $src $out/m2/$m2Path/$m2File
|
|
'';
|
|
|
|
phases = "installPhase";
|
|
}
|