From 2d52be000fd82833b121042ca16d2c4801ecc55e Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Mon, 4 Jan 2021 20:48:20 +0000 Subject: [PATCH] tiny-remapper: init --- nix/pkgs/default.nix | 1 + nix/pkgs/tiny-remapper.nix | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 nix/pkgs/tiny-remapper.nix diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 0e950c3daf..ec2b0f0e80 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -18,5 +18,6 @@ envoy = import ./envoy args; deluge = import ./deluge args; grafana-plugins = import ./grafana-plugins args; + tiny-remapper = import ./tiny-remapper.nix args; } // (import ./heptapod-runner.nix args) // (import ./lightspeed args) diff --git a/nix/pkgs/tiny-remapper.nix b/nix/pkgs/tiny-remapper.nix new file mode 100644 index 0000000000..c68dfe99da --- /dev/null +++ b/nix/pkgs/tiny-remapper.nix @@ -0,0 +1,27 @@ +{ depot, pkgs, ... }: +let + inherit (pkgs) stdenvNoCC fetchurl makeWrapper; + java = pkgs.jdk; +in +stdenvNoCC.mkDerivation rec { + pname = "tiny-remapper"; + version = "0.3.2"; + + src = fetchurl { + url = "https://maven.fabricmc.net/net/fabricmc/tiny-remapper/${version}/tiny-remapper-${version}-fat.jar"; + sha256 = "d8301fbe684d10849003dc92d18f24ec53cf755c3a6fdfe371d581cb30bd47e1"; + }; + + dontBuild = true; + dontUnpack = true; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + mkdir -p $out/lib $out/bin + cp $src $out/lib/tiny-remapper-${version}-fat.jar + makeWrapper ${java}/bin/java $out/bin/tiny-remapper \ + --set JAVA_HOME ${java} \ + --add-flags "-jar $out/lib/tiny-remapper-${version}-fat.jar" + ''; +}