about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2022-12-07 13:35:45 -0300
committerGitHub <noreply@github.com>2022-12-07 13:35:45 -0300
commit15b09f2e75c6fe6354bdf762660cd4051f4f53f3 (patch)
tree6bc38561b8efc92003d51eda65be6d6bb4ebc5f0
parent7d04753e2f8d5231bff50e76a52a7b994a831f88 (diff)
parentbc2eeb02ab82848346bf51eaa9f8efeeebe292a6 (diff)
Merge pull request #200195 from Sohalt/bbin
bbin: init at 0.1.4
-rw-r--r--pkgs/development/tools/bbin/default.nix44
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/development/tools/bbin/default.nix b/pkgs/development/tools/bbin/default.nix
new file mode 100644
index 0000000000000..55e152e22ab40
--- /dev/null
+++ b/pkgs/development/tools/bbin/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, stdenvNoCC
+, fetchFromGitHub
+, makeWrapper
+, babashka
+, graalvm17-ce
+}:
+
+stdenvNoCC.mkDerivation rec {
+  pname = "bbin";
+  version = "0.1.4";
+
+  src = fetchFromGitHub {
+    owner = "babashka";
+    repo = "bbin";
+    rev = "v${version}";
+    sha256 = "sha256-Oo6YF+uxcUG26Pz1X5uzPE/Hsx0UToOErZ2oUiKuZyI=";
+  };
+
+  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 graalvm17-ce ]}"
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/babashka/bbin";
+    description = "Install any Babashka script or project with one command";
+    license = licenses.mit;
+    inherit (babashka.meta) platforms;
+    maintainers = with maintainers; [ sohalt ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index f8097c7df7620..3bccd62544dde 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5972,6 +5972,8 @@ with pkgs;
 
   artim-dark = callPackage ../data/themes/artim-dark {};
 
+  bbin = callPackage ../development/tools/bbin {};
+
   bore = callPackage ../tools/networking/bore {
     inherit (darwin) Libsystem;
     inherit (darwin.apple_sdk.frameworks) SystemConfiguration;