nixpkgs/pkgs/applications/networking/cluster/kubecfg/default.nix
2023-10-01 11:29:57 +00:00

42 lines
983 B
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
pname = "kubecfg";
version = "0.34.0";
src = fetchFromGitHub {
owner = "kubecfg";
repo = "kubecfg";
rev = "v${version}";
hash = "sha256-OoqmFv2cRUU/mDtDcXugx+NKwpePQzRD231YBT4xQmA=";
};
vendorHash = "sha256-0+I0EeCguo1RPwKlnqmxgwvRfuW1CKD58PhftZDLfSg=";
ldflags = [
"-s"
"-w"
"-X main.version=v${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd kubecfg \
--bash <($out/bin/kubecfg completion --shell=bash) \
--zsh <($out/bin/kubecfg completion --shell=zsh)
'';
meta = with lib; {
description = "A tool for managing Kubernetes resources as code";
homepage = "https://github.com/kubecfg/kubecfg";
changelog = "https://github.com/kubecfg/kubecfg/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ benley qjoly ];
};
}