diff --git a/pkgs/by-name/ku/kubectl-ai/package.nix b/pkgs/by-name/ku/kubectl-ai/package.nix new file mode 100644 index 000000000000..0545b0caa33d --- /dev/null +++ b/pkgs/by-name/ku/kubectl-ai/package.nix @@ -0,0 +1,43 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, +}: + +buildGoModule (finalAttrs: { + pname = "kubectl-ai"; + version = "0.0.9"; + + src = fetchFromGitHub { + owner = "GoogleCloudPlatform"; + repo = "kubectl-ai"; + rev = "v${finalAttrs.version}"; + hash = "sha256-zsqHRXUyRguDbY3yPCWJ9KLzF6VR/y7juzI9uaVPSAE="; + }; + + vendorHash = "sha256-VpTAq9rXDPBOdaZIXm7h4AP1YFOk7HzLiUxYaCOP/w8="; + + # Build the main command + subPackages = [ "cmd" ]; + + postInstall = '' + mv $out/bin/{cmd,kubectl-ai} + ''; + + ldflags = [ + "-s" + "-w" + "-X main.version=${finalAttrs.version}" + ]; + + # Disable the automatic subpackage detection + doCheck = false; + + meta = { + description = "AI powered Kubernetes Assistant"; + homepage = "https://github.com/GoogleCloudPlatform/kubectl-ai"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ pilz ]; + mainProgram = "kubectl-ai"; + }; +})