nixpkgs/pkgs/development/tools/repository-managers/nexus/default.nix
2018-06-26 21:37:07 -04:00

46 lines
1.1 KiB
Nix

{ stdenv, fetchurl, makeWrapper, jre, gawk }:
stdenv.mkDerivation rec {
name = "nexus-${version}";
version = "3.12.1-01";
src = fetchurl {
url = "https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-${version}-unix.tar.gz";
sha256 = "1vv50zv3cr42rq1g16gdl2d1hrxna2jjynlr7kivzlbyfq89ic3f";
};
sourceRoot = name;
nativeBuildInputs = [ makeWrapper ];
patches = [ ./nexus-bin.patch ./nexus-vm-opts.patch ];
postPatch = ''
substituteInPlace bin/nexus.vmoptions \
--replace etc/karaf $out/etc/karaf \
--replace =. =$out
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -rfv * .install4j $out
rm -fv $out/bin/nexus.bat
wrapProgram $out/bin/nexus \
--set JAVA_HOME ${jre} \
--set ALTERNATIVE_NAME "nexus" \
--prefix PATH "${stdenv.lib.makeBinPath [ gawk ]}"
runHook postInstall
'';
meta = with stdenv.lib; {
description = "Repository manager for binary software components";
homepage = http://www.sonatype.org/nexus;
license = licenses.epl10;
platforms = platforms.all;
maintainers = with maintainers; [ aespinosa ironpinguin ma27 ];
};
}