nixpkgs/pkgs/development/tools/repository-managers/nexus/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

49 lines
1.2 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper, jre_headless, gawk }:
stdenv.mkDerivation rec {
pname = "nexus";
version = "3.29.0-02";
src = fetchurl {
url = "https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-${version}-unix.tar.gz";
sha256 = "0yxk3yy9vllxc9v4dn3fs8hh389lrw2g8gg24rx1w8bg05rrrr8z";
};
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 "${stdenv.lib.makeBinPath [ gawk ]}"
runHook postInstall
'';
meta = with 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 zaninime ];
};
}