|
|
|
@ -1,22 +1,39 @@ |
|
|
|
|
{ lib, buildGoModule, fetchFromGitHub }: |
|
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: |
|
|
|
|
|
|
|
|
|
buildGoModule rec { |
|
|
|
|
pname = "konstraint"; |
|
|
|
|
version = "0.18.0"; |
|
|
|
|
version = "0.19.0"; |
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub { |
|
|
|
|
owner = "plexsystems"; |
|
|
|
|
repo = pname; |
|
|
|
|
rev = "v${version}"; |
|
|
|
|
sha256 = "sha256-UHdmC6UoDxl/GfvUOmuBctPpxIYljOurnm1J3eEPFHA="; |
|
|
|
|
sha256 = "sha256-BoH/lT+kYiwOtW82mmhhLZY3Xk2pRZHmNrEKJzPiG54="; |
|
|
|
|
}; |
|
|
|
|
vendorSha256 = "sha256-UssvmmZhq+SO3cPpZi3Diji7tIxrpyhqNIBajqzRjh8="; |
|
|
|
|
vendorSha256 = "sha256-G6WigkkKZj/k+kYlKItSfnoXN8UZ60lFEkZcQaI9J5c="; |
|
|
|
|
|
|
|
|
|
# Exclude go within .github folder |
|
|
|
|
excludedPackages = ".github"; |
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ]; |
|
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" "-X github.com/plexsystems/konstraint/internal/commands.version=${version}" ]; |
|
|
|
|
|
|
|
|
|
postInstall = '' |
|
|
|
|
installShellCompletion --cmd konstraint \ |
|
|
|
|
--bash <($out/bin/konstraint completion bash) \ |
|
|
|
|
--fish <($out/bin/konstraint completion fish) \ |
|
|
|
|
--zsh <($out/bin/konstraint completion zsh) |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
doInstallCheck = true; |
|
|
|
|
installCheckPhase = '' |
|
|
|
|
runHook preInstallCheck |
|
|
|
|
$out/bin/konstraint --help |
|
|
|
|
$out/bin/konstraint --version | grep "${version}" |
|
|
|
|
runHook postInstallCheck |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
meta = with lib; { |
|
|
|
|
homepage = "https://github.com/plexsystems/konstraint"; |
|
|
|
|
changelog = "https://github.com/plexsystems/konstraint/releases/tag/v${version}"; |
|
|
|
|