nixpkgs/pkgs/development/tools/repository-managers/nexus/default.nix

47 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, makeWrapper, jre, gawk }:
nexus: fix setup and nixos test (#40522) The original `nexus` derivation required `/run/sonatype-work/nexus3` which explicitly depended on the NixOS path structure. This would break `nexus` for everyone using `nixpkgs` on a non-NixOS system, additionally the module never created `/run/sonatype-work`, so the systemd unit created in `services.nexus` fails as well. The issue wasn't actively known as the `nixos/nexus` test wasn't registered in Hydra (see #40257). This patch contains the following changes: * Adds `tests.nexus` to `release.nix` to run the test on Hydra. * Makes JVM parameters configurable: by default all JVM options were located in `result/bin/nexus.vmoptions` which made it quite hard to patch these parameters. Now it's possible to override all parameters by running `VM_OPTS_FILE=custom-nexus.vmoptions ./result/bin/nexus run` (after patching the `nexus` shell script), additionally it's possible to override these parameters with `services.nexus.vmoptions`. * Bumped Nexus from 3.5.1 to 3.11.0 * Run the `nexus` test on Hydra with `callTest` in `nixos/release.nix`, furthermore the test checks if the UI is available on the specified port. * Added myself as maintainer for the NixOS test and the package to have some more people in case of further breakage. * Added sufficient disk space to the `nexus` test, otherwise the service fails with the following errors: ``` com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database 'accesslog' com.orientechnologies.orient.core.exception.OLowDiskSpaceException: Error occurred while executing a write operation to database 'accesslog' due to limited free space on the disk (242 MB). The database is now working in read-only mode. Please close the database (or stop OrientDB), make room on your hard drive and then reopen the database. The minimal required space is 256 MB. Required space is now set to 256MB (you can change it by setting parameter storage.diskCache.diskFreeSpaceLimit) . ``` /cc @ironpinguin @xeji
2018-05-15 12:10:29 +00:00
2015-09-26 04:00:22 +00:00
stdenv.mkDerivation rec {
name = "nexus-${version}";
2018-06-27 01:37:07 +00:00
version = "3.12.1-01";
2015-09-26 04:00:22 +00:00
src = fetchurl {
2018-06-27 01:37:07 +00:00
url = "https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-${version}-unix.tar.gz";
sha256 = "1vv50zv3cr42rq1g16gdl2d1hrxna2jjynlr7kivzlbyfq89ic3f";
2015-09-26 04:00:22 +00:00
};
sourceRoot = name;
nativeBuildInputs = [ makeWrapper ];
2015-09-26 04:00:22 +00:00
nexus: fix setup and nixos test (#40522) The original `nexus` derivation required `/run/sonatype-work/nexus3` which explicitly depended on the NixOS path structure. This would break `nexus` for everyone using `nixpkgs` on a non-NixOS system, additionally the module never created `/run/sonatype-work`, so the systemd unit created in `services.nexus` fails as well. The issue wasn't actively known as the `nixos/nexus` test wasn't registered in Hydra (see #40257). This patch contains the following changes: * Adds `tests.nexus` to `release.nix` to run the test on Hydra. * Makes JVM parameters configurable: by default all JVM options were located in `result/bin/nexus.vmoptions` which made it quite hard to patch these parameters. Now it's possible to override all parameters by running `VM_OPTS_FILE=custom-nexus.vmoptions ./result/bin/nexus run` (after patching the `nexus` shell script), additionally it's possible to override these parameters with `services.nexus.vmoptions`. * Bumped Nexus from 3.5.1 to 3.11.0 * Run the `nexus` test on Hydra with `callTest` in `nixos/release.nix`, furthermore the test checks if the UI is available on the specified port. * Added myself as maintainer for the NixOS test and the package to have some more people in case of further breakage. * Added sufficient disk space to the `nexus` test, otherwise the service fails with the following errors: ``` com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database 'accesslog' com.orientechnologies.orient.core.exception.OLowDiskSpaceException: Error occurred while executing a write operation to database 'accesslog' due to limited free space on the disk (242 MB). The database is now working in read-only mode. Please close the database (or stop OrientDB), make room on your hard drive and then reopen the database. The minimal required space is 256 MB. Required space is now set to 256MB (you can change it by setting parameter storage.diskCache.diskFreeSpaceLimit) . ``` /cc @ironpinguin @xeji
2018-05-15 12:10:29 +00:00
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 ]}"
nexus: fix setup and nixos test (#40522) The original `nexus` derivation required `/run/sonatype-work/nexus3` which explicitly depended on the NixOS path structure. This would break `nexus` for everyone using `nixpkgs` on a non-NixOS system, additionally the module never created `/run/sonatype-work`, so the systemd unit created in `services.nexus` fails as well. The issue wasn't actively known as the `nixos/nexus` test wasn't registered in Hydra (see #40257). This patch contains the following changes: * Adds `tests.nexus` to `release.nix` to run the test on Hydra. * Makes JVM parameters configurable: by default all JVM options were located in `result/bin/nexus.vmoptions` which made it quite hard to patch these parameters. Now it's possible to override all parameters by running `VM_OPTS_FILE=custom-nexus.vmoptions ./result/bin/nexus run` (after patching the `nexus` shell script), additionally it's possible to override these parameters with `services.nexus.vmoptions`. * Bumped Nexus from 3.5.1 to 3.11.0 * Run the `nexus` test on Hydra with `callTest` in `nixos/release.nix`, furthermore the test checks if the UI is available on the specified port. * Added myself as maintainer for the NixOS test and the package to have some more people in case of further breakage. * Added sufficient disk space to the `nexus` test, otherwise the service fails with the following errors: ``` com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database 'accesslog' com.orientechnologies.orient.core.exception.OLowDiskSpaceException: Error occurred while executing a write operation to database 'accesslog' due to limited free space on the disk (242 MB). The database is now working in read-only mode. Please close the database (or stop OrientDB), make room on your hard drive and then reopen the database. The minimal required space is 256 MB. Required space is now set to 256MB (you can change it by setting parameter storage.diskCache.diskFreeSpaceLimit) . ``` /cc @ironpinguin @xeji
2018-05-15 12:10:29 +00:00
runHook postInstall
'';
2015-09-26 04:00:22 +00:00
meta = with stdenv.lib; {
description = "Repository manager for binary software components";
homepage = http://www.sonatype.org/nexus;
license = licenses.epl10;
platforms = platforms.all;
nexus: fix setup and nixos test (#40522) The original `nexus` derivation required `/run/sonatype-work/nexus3` which explicitly depended on the NixOS path structure. This would break `nexus` for everyone using `nixpkgs` on a non-NixOS system, additionally the module never created `/run/sonatype-work`, so the systemd unit created in `services.nexus` fails as well. The issue wasn't actively known as the `nixos/nexus` test wasn't registered in Hydra (see #40257). This patch contains the following changes: * Adds `tests.nexus` to `release.nix` to run the test on Hydra. * Makes JVM parameters configurable: by default all JVM options were located in `result/bin/nexus.vmoptions` which made it quite hard to patch these parameters. Now it's possible to override all parameters by running `VM_OPTS_FILE=custom-nexus.vmoptions ./result/bin/nexus run` (after patching the `nexus` shell script), additionally it's possible to override these parameters with `services.nexus.vmoptions`. * Bumped Nexus from 3.5.1 to 3.11.0 * Run the `nexus` test on Hydra with `callTest` in `nixos/release.nix`, furthermore the test checks if the UI is available on the specified port. * Added myself as maintainer for the NixOS test and the package to have some more people in case of further breakage. * Added sufficient disk space to the `nexus` test, otherwise the service fails with the following errors: ``` com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database 'accesslog' com.orientechnologies.orient.core.exception.OLowDiskSpaceException: Error occurred while executing a write operation to database 'accesslog' due to limited free space on the disk (242 MB). The database is now working in read-only mode. Please close the database (or stop OrientDB), make room on your hard drive and then reopen the database. The minimal required space is 256 MB. Required space is now set to 256MB (you can change it by setting parameter storage.diskCache.diskFreeSpaceLimit) . ``` /cc @ironpinguin @xeji
2018-05-15 12:10:29 +00:00
maintainers = with maintainers; [ aespinosa ironpinguin ma27 ];
2015-09-26 04:00:22 +00:00
};
}