nixpkgs/pkgs/development/tools/kubeswitch/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.3 KiB
Nix
Raw Normal View History

{
lib,
buildGoModule,
fetchFromGitHub,
testers,
kubeswitch,
installShellFiles,
}:
2022-09-21 07:31:44 +02:00
buildGoModule rec {
pname = "kubeswitch";
2024-04-21 08:17:54 +02:00
version = "0.9.1";
2022-09-21 07:31:44 +02:00
src = fetchFromGitHub {
owner = "danielfoehrKn";
repo = "kubeswitch";
2022-09-21 07:31:44 +02:00
rev = version;
2024-04-21 08:17:54 +02:00
hash = "sha256-cvMTuiXSpx+ZicN1P3JjGExzW7d51nN1YIpsGArXHzw=";
2022-09-21 07:31:44 +02:00
};
2023-08-06 08:38:14 +02:00
vendorHash = null;
2022-09-21 07:31:44 +02:00
subPackages = [ "cmd/main.go" ];
ldflags = [
"-s"
"-w"
2022-09-21 07:31:44 +02:00
"-X github.com/danielfoehrkn/kubeswitch/cmd/switcher.version=${version}"
"-X github.com/danielfoehrkn/kubeswitch/cmd/switcher.buildDate=1970-01-01"
];
nativeBuildInputs = [ installShellFiles ];
2022-09-21 07:31:44 +02:00
postInstall = ''
mv $out/bin/main $out/bin/switcher
for shell in bash zsh fish; do
$out/bin/switcher --cmd switcher completion $shell > switcher.$shell
installShellCompletion --$shell switcher.$shell
done
2022-09-21 07:31:44 +02:00
'';
passthru.tests.version = testers.testVersion { package = kubeswitch; };
meta = {
changelog = "https://github.com/danielfoehrKn/kubeswitch/releases/tag/${version}";
description = "The kubectx for operators, a drop-in replacement for kubectx";
license = lib.licenses.asl20;
2022-09-21 07:31:44 +02:00
homepage = "https://github.com/danielfoehrKn/kubeswitch";
maintainers = with lib.maintainers; [ bryanasdev000 ];
mainProgram = "switcher";
2022-09-21 07:31:44 +02:00
};
}