nixpkgs/pkgs/development/tools/bbin/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.0 KiB
Nix
Raw Normal View History

2022-11-08 11:19:05 +00:00
{ lib
, stdenvNoCC
, fetchFromGitHub
2023-11-01 14:18:15 +00:00
, gitUpdater
2022-11-08 11:19:05 +00:00
, makeWrapper
, babashka-unwrapped
2022-11-08 11:19:05 +00:00
}:
stdenvNoCC.mkDerivation rec {
pname = "bbin";
2023-11-01 13:44:37 +00:00
version = "0.2.1";
2022-11-08 11:19:05 +00:00
src = fetchFromGitHub {
owner = "babashka";
repo = "bbin";
rev = "v${version}";
2023-11-01 13:44:37 +00:00
sha256 = "sha256-mF8+Fm1vwLUw5l2PqV+vFFlr6y2JpKBwc+J3PdKQ6Fo=";
2022-11-08 11:19:05 +00:00
};
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 ]}"
2022-11-08 11:19:05 +00:00
runHook postInstall
'';
2023-11-01 14:18:15 +00:00
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
};
2022-11-08 11:19:05 +00:00
meta = with lib; {
homepage = "https://github.com/babashka/bbin";
description = "Install any Babashka script or project with one command";
license = licenses.mit;
inherit (babashka-unwrapped.meta) platforms;
2022-11-08 11:19:05 +00:00
maintainers = with maintainers; [ sohalt ];
};
}