biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / kubeswitch / default.nix
blob470fdac9b3c22a1767d34c07bce34b33b8970341
2   lib,
3   buildGoModule,
4   fetchFromGitHub,
5   testers,
6   kubeswitch,
7   installShellFiles,
8 }:
10 buildGoModule rec {
11   pname = "kubeswitch";
12   version = "0.9.1";
14   src = fetchFromGitHub {
15     owner = "danielfoehrKn";
16     repo = "kubeswitch";
17     rev = version;
18     hash = "sha256-cvMTuiXSpx+ZicN1P3JjGExzW7d51nN1YIpsGArXHzw=";
19   };
21   vendorHash = null;
23   subPackages = [ "cmd/main.go" ];
25   ldflags = [
26     "-s"
27     "-w"
28     "-X github.com/danielfoehrkn/kubeswitch/cmd/switcher.version=${version}"
29     "-X github.com/danielfoehrkn/kubeswitch/cmd/switcher.buildDate=1970-01-01"
30   ];
32   nativeBuildInputs = [ installShellFiles ];
34   postInstall = ''
35     mv $out/bin/main $out/bin/switcher
36     for shell in bash zsh fish; do
37       $out/bin/switcher --cmd switcher completion $shell > switcher.$shell
38       installShellCompletion --$shell switcher.$shell
39     done
40   '';
42   passthru.tests.version = testers.testVersion { package = kubeswitch; };
44   meta = {
45     changelog = "https://github.com/danielfoehrKn/kubeswitch/releases/tag/${version}";
46     description = "The kubectx for operators, a drop-in replacement for kubectx";
47     license = lib.licenses.asl20;
48     homepage = "https://github.com/danielfoehrKn/kubeswitch";
49     maintainers = with lib.maintainers; [ bryanasdev000 ];
50     mainProgram = "switcher";
51   };