Skip to content

Commit

Permalink
Merge pull request #277606 from zshipko/update-extism-cli
Browse files Browse the repository at this point in the history
extism-cli: 0.1.0 -> 0.3.8
  • Loading branch information
Janik-Haag authored Dec 31, 2023
2 parents 4c89672 + c387a33 commit 3d54a95
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20764,6 +20764,12 @@
githubId = 8100652;
name = "David Mell";
};
zshipko = {
email = "[email protected]";
github = "zshipko";
githubId = 332534;
name = "Zach Shipko";
};
ztzg = {
email = "[email protected]";
github = "ztzg";
Expand Down
40 changes: 23 additions & 17 deletions pkgs/development/tools/extism-cli/default.nix
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
{ lib, stdenvNoCC, fetchFromGitHub, python3, makeBinaryWrapper }:

stdenvNoCC.mkDerivation rec {
{
lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:

buildGoModule rec {
pname = "extism-cli";
version = "0.1.0";
version = "0.3.8";

src = fetchFromGitHub {
owner = "extism";
repo = "cli";
rev = "97935786166e82154266b82410028482800e6061";
sha256 = "sha256-LRzXuZQt5h3exw43UXUwLVIhveYVFw/SQ2YtHI9ZnWc=";
rev = "refs/tags/v${version}";
hash = "sha256-StMipPMLSQzrhWv0yoKkNiuHMRW7QIhmVZ/M27WDWrM=";
};

buildInputs = [ python3 ];
nativeBuildInputs = [ makeBinaryWrapper ];
modRoot = "./extism";

installPhase = ''
runHook preInstall
vendorHash = "sha256-sSKiwYT5EP0FQJbhgv9ZFDwwwvIJ66yMULbj529AZwY=";

install -D -m 755 ./extism_cli/__init__.py "$out/bin/extism"
nativeBuildInputs = [ installShellFiles ];

# The extism cli tries by default to install a library and header into /usr/local which does not work on NixOS.
# Pass a reasonable writable directory which can still be overwritten with another --prefix argument.
wrapProgram "$out/bin/extism" \
--add-flags '--prefix $HOME/.local'
doCheck = false; # Tests require network access

runHook postInstall
postInstall = ''
local INSTALL="$out/bin/extism"
installShellCompletion --cmd extism \
--bash <($out/bin/containerlab completion bash) \
--fish <($out/bin/containerlab completion fish) \
--zsh <($out/bin/containerlab completion zsh)
'';

meta = with lib; {
description = "The extism CLI is used to manage Extism installations";
homepage = "https://github.com/extism/cli";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
maintainers = with maintainers; [ zshipko ];
mainProgram = "extism";
platforms = platforms.all;
};
}

0 comments on commit 3d54a95

Please sign in to comment.