1{
2 lib,
3 stdenvNoCC,
4 fetchFromGitHub,
5 gitUpdater,
6 makeWrapper,
7 babashka-unwrapped,
8}:
9
10stdenvNoCC.mkDerivation rec {
11 pname = "bbin";
12 version = "0.2.4";
13
14 src = fetchFromGitHub {
15 owner = "babashka";
16 repo = "bbin";
17 rev = "v${version}";
18 sha256 = "sha256-26uZqHSLi+qnilyPWt/2mCr1wyu1flxNd+jq9zbumrg=";
19 };
20
21 nativeBuildInputs = [ makeWrapper ];
22
23 dontConfigure = true;
24 dontBuild = true;
25
26 installPhase = ''
27 runHook preInstall
28
29 install -D bbin $out/bin/bbin
30 mkdir -p $out/share
31 cp -r docs $out/share/docs
32 wrapProgram $out/bin/bbin \
33 --prefix PATH : "${
34 lib.makeBinPath [
35 babashka-unwrapped
36 babashka-unwrapped.graalvmDrv
37 ]
38 }"
39
40 runHook postInstall
41 '';
42
43 passthru = {
44 updateScript = gitUpdater { rev-prefix = "v"; };
45 };
46
47 meta = with lib; {
48 homepage = "https://github.com/babashka/bbin";
49 description = "Install any Babashka script or project with one command";
50 mainProgram = "bbin";
51 license = licenses.mit;
52 inherit (babashka-unwrapped.meta) platforms;
53 maintainers = with maintainers; [ sohalt ];
54 };
55}