{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles, }: buildGoModule rec { pname = "ctlptl"; version = "0.9.0"; src = fetchFromGitHub { owner = "tilt-dev"; repo = "ctlptl"; rev = "v${version}"; hash = "sha256-y957JaHg2SnDC6yvwI/0fBFjbEKOfKFsNqOOrqQe+TU="; }; vendorHash = "sha256-gJiarW1uYr5vl9nt+JN6/yRyYr9J0sfDVZcNLLcwPJY="; nativeBuildInputs = [ installShellFiles ]; subPackages = [ "cmd/ctlptl" ]; ldflags = [ "-s" "-w" "-X main.version=${version}" ]; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd ctlptl \ --bash <($out/bin/ctlptl completion bash) \ --fish <($out/bin/ctlptl completion fish) \ --zsh <($out/bin/ctlptl completion zsh) ''; meta = { description = "CLI for declaratively setting up local Kubernetes clusters"; homepage = "https://github.com/tilt-dev/ctlptl"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ svrana ]; }; }