Files
nixpkgs/pkgs/servers/monitoring/prometheus/jmx-httpserver.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

42 lines
1.1 KiB
Nix

{
lib,
stdenv,
fetchurl,
jre,
makeWrapper,
}:
stdenv.mkDerivation rec {
pname = "jmx-prometheus-httpserver";
version = "0.15.0";
jarName = "jmx_prometheus_httpserver-${version}-jar-with-dependencies.jar";
src = fetchurl {
url = "mirror://maven/io/prometheus/jmx/jmx_prometheus_httpserver/${version}/${jarName}";
sha256 = "0fr3svn8kjp7bq1wzbkvv5awylwn8b01bngj04zvk7fpzqpgs7mz";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
dontUnpack = true;
installPhase = ''
mkdir -p $out/libexec
mkdir -p $out/bin
cp $src $out/libexec/$jarName
makeWrapper "${jre}/bin/java" $out/bin/jmx_prometheus_httpserver --add-flags "-jar $out/libexec/$jarName"
'';
meta = {
homepage = "https://github.com/prometheus/jmx_exporter";
description = "Process for exposing JMX Beans via HTTP for Prometheus consumption";
mainProgram = "jmx_prometheus_httpserver";
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.offline ];
platforms = lib.platforms.unix;
};
}