nixpkgs/pkgs/development/tools/repository-managers/nexus/default.nix
Robert Scott 3b6bc4b69c treewide: set sourceProvenance for packages containing downloaded jars
these are the easily identifiable cases and will not be comprehensive
2022-06-04 19:47:57 +01:00

50 lines
1.3 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper, jre_headless, gawk }:
stdenv.mkDerivation rec {
pname = "nexus";
version = "3.37.3-02";
src = fetchurl {
url = "https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-${version}-unix.tar.gz";
sha256 = "sha256-wdtDGQjFp2tEAVxVXW70UXq/CoaET6/+4PXWxiNZMS0=";
};
preferLocalBuild = true;
sourceRoot = "${pname}-${version}";
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_headless} \
--set ALTERNATIVE_NAME "nexus" \
--prefix PATH "${lib.makeBinPath [ gawk ]}"
runHook postInstall
'';
meta = with lib; {
description = "Repository manager for binary software components";
homepage = "http://www.sonatype.org/nexus";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.epl10;
platforms = platforms.all;
maintainers = with maintainers; [ aespinosa ironpinguin zaninime ];
};
}