about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/kubeswitch/default.nix
blob: 76aeeb2e94c89509bc71b4017c1f7efa89694526 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ lib, buildGoModule, fetchFromGitHub, testers, kubeswitch }:

buildGoModule rec {
  pname = "kubeswitch";
  version = "0.8.1";

  src = fetchFromGitHub {
    owner = "danielfoehrKn";
    repo = pname;
    rev = version;
    sha256 = "sha256-zf7o41YYAppRge0EMXgIN8rI5Kco4/n7BJ90b/X6L1M=";
  };

  vendorHash = 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";
  };
}