1 { stdenv, lib, fetchzip, jdk, makeWrapper, coreutils, curl }:
3 stdenv.mkDerivation rec {
8 url = "https://github.com/jbangdev/jbang/releases/download/v${version}/${pname}-${version}.tar";
9 sha256 = "sha256-ebwBRzgpYEomboY+hMok8KmOaNR4hRaPy7SxjHbLeYU=";
12 nativeBuildInputs = [ makeWrapper ];
16 rm bin/jbang.{cmd,ps1}
18 wrapProgram $out/bin/jbang \
19 --set JAVA_HOME ${jdk} \
20 --set PATH ${lib.makeBinPath [ (placeholder "out") coreutils jdk curl ]}
24 installCheckPhase = ''
25 $out/bin/jbang --version 2>&1 | grep -q "${version}"
29 description = "Run java as scripts anywhere";
30 mainProgram = "jbang";
32 jbang uses the java language to build scripts similar to groovy scripts. Dependencies are automatically
33 downloaded and the java code runs.
35 homepage = "https://www.jbang.dev";
36 license = licenses.mit;
37 platforms = platforms.all;
38 maintainers = with maintainers; [ moaxcp ];