depot/third_party/nixpkgs/pkgs/development/tools/bbin/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

49 lines
1.1 KiB
Nix

{ lib
, stdenvNoCC
, fetchFromGitHub
, gitUpdater
, makeWrapper
, babashka-unwrapped
}:
stdenvNoCC.mkDerivation rec {
pname = "bbin";
version = "0.2.3";
src = fetchFromGitHub {
owner = "babashka";
repo = "bbin";
rev = "v${version}";
sha256 = "sha256-tWk5HzDKff+wwqRjLYbjfio3aQC6Xz5vsMf/NLm+Scc=";
};
nativeBuildInputs = [ makeWrapper ];
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
install -D bbin $out/bin/bbin
mkdir -p $out/share
cp -r docs $out/share/docs
wrapProgram $out/bin/bbin \
--prefix PATH : "${lib.makeBinPath [ babashka-unwrapped babashka-unwrapped.graalvmDrv ]}"
runHook postInstall
'';
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
};
meta = with lib; {
homepage = "https://github.com/babashka/bbin";
description = "Install any Babashka script or project with one command";
mainProgram = "bbin";
license = licenses.mit;
inherit (babashka-unwrapped.meta) platforms;
maintainers = with maintainers; [ sohalt ];
};
}