From 31857704c9c8b331727fa2a0e0a553e899e570e0 Mon Sep 17 00:00:00 2001 From: "Bryan A. S" Date: Wed, 21 Sep 2022 02:31:44 -0300 Subject: [PATCH] kubeswitch: init at 0.7.2 --- pkgs/development/tools/kubeswitch/default.nix | 40 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/tools/kubeswitch/default.nix diff --git a/pkgs/development/tools/kubeswitch/default.nix b/pkgs/development/tools/kubeswitch/default.nix new file mode 100644 index 000000000000..2e683ecc31a4 --- /dev/null +++ b/pkgs/development/tools/kubeswitch/default.nix @@ -0,0 +1,40 @@ +{ lib, buildGoModule, fetchFromGitHub, testers, kubeswitch }: + +buildGoModule rec { + pname = "kubeswitch"; + version = "0.7.2"; + + src = fetchFromGitHub { + owner = "danielfoehrKn"; + repo = pname; + rev = version; + sha256 = "sha256-p4/nYZt+OwNsFX9f9ySfQaz6gbz+8Mvt00W2Rs4dpCY="; + }; + + vendorSha256 = null; + + subPackages = [ "cmd/main.go" ]; + + ldflags = [ + "-s" "-w" + "-X github.com/danielfoehrkn/kubeswitch/cmd/switcher.version=${version}" + "-X github.com/danielfoehrkn/kubeswitch/cmd/switcher.buildDate=1970-01-01" + + ]; + + passthru.tests.version = testers.testVersion { + package = kubeswitch; + }; + + postInstall = '' + mv $out/bin/main $out/bin/switch + ''; + + meta = with lib; { + description = "The kubectx for operators"; + license = licenses.asl20; + homepage = "https://github.com/danielfoehrKn/kubeswitch"; + maintainers = with maintainers; [ bryanasdev000 ]; + mainProgram = "switch"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ce4a69104f56..430794e23fb0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16638,6 +16638,8 @@ with pkgs; kubespy = callPackage ../applications/networking/cluster/kubespy { }; + kubeswitch = callPackage ../development/tools/kubeswitch { }; + kubie = callPackage ../development/tools/kubie { inherit (darwin.apple_sdk.frameworks) Security; };