diff --git a/pkgs/applications/networking/cluster/kn/default.nix b/pkgs/applications/networking/cluster/kn/default.nix new file mode 100644 index 000000000000..a41c3c0ad35b --- /dev/null +++ b/pkgs/applications/networking/cluster/kn/default.nix @@ -0,0 +1,44 @@ +{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: + +buildGoModule rec { + pname = "kn"; + version = "0.26.0"; + + src = fetchFromGitHub { + owner = "knative"; + repo = "client"; + rev = "v${version}"; + sha256 = "sha256-hquxv1BluR535WvMtJlVyP7JuARDNGDjPAbdSSj2juo="; + }; + + vendorSha256 = null; + + subPackages = [ "cmd/kn" ]; + + nativeBuildInputs = [ installShellFiles ]; + + ldflags = [ + "-X knative.dev/client/pkg/kn/commands/version.Version=v${version}" + "-X knative.dev/client/pkg/kn/commands/version.VersionEventing=v${version}" + "-X knative.dev/client/pkg/kn/commands/version.VersionServing=v${version}" + ]; + + postInstall = '' + installShellCompletion --cmd kn \ + --bash <($out/bin/kn completion bash) \ + --zsh <($out/bin/kn completion zsh) + ''; + + doInstallCheck = true; + installCheckPhase = '' + $out/bin/kn version | grep ${version} > /dev/null + ''; + + meta = with lib; { + description = "The Knative client kn is your door to the Knative world. It allows you to create Knative resources interactively from the command line or from within scripts"; + homepage = "https://github.com/knative/client"; + changelog = "https://github.com/knative/client/releases/tag/v${version}"; + license = licenses.asl20; + maintainers = with maintainers; [ bryanasdev000 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 496788f6e53e..e2f6f1763e06 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -25833,6 +25833,8 @@ with pkgs; kmymoney = libsForQt5.callPackage ../applications/office/kmymoney { }; + kn = callPackage ../applications/networking/cluster/kn { }; + kodestudio = callPackage ../applications/editors/kodestudio { }; kondo = callPackage ../applications/misc/kondo { };