nixpkgs/pkgs/applications/networking/cluster/stern/default.nix

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

39 lines
1.0 KiB
Nix
Raw Normal View History

{ stdenv, lib, buildPackages, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "stern";
2023-04-16 23:49:21 +00:00
version = "1.25.0";
2018-10-01 21:56:08 +00:00
src = fetchFromGitHub {
owner = "stern";
2018-10-01 21:56:08 +00:00
repo = "stern";
rev = "v${version}";
2023-04-16 23:49:21 +00:00
sha256 = "sha256-E4Hs9FH+6iQ7kv6CmYUHw9HchtJghMq9tnERO2rpL1g=";
2018-10-01 21:56:08 +00:00
};
2023-04-16 23:49:21 +00:00
vendorHash = "sha256-+B3cAuV+HllmB1NaPeZitNpX9udWuCKfDFv+mOVHw2Y=";
2021-06-30 04:40:51 +00:00
subPackages = [ "." ];
2018-10-01 21:56:08 +00:00
2020-04-26 03:16:52 +00:00
nativeBuildInputs = [ installShellFiles ];
ldflags = [ "-s" "-w" "-X github.com/stern/stern/cmd.version=${version}" ];
postInstall = let
stern = if stdenv.buildPlatform.canExecute stdenv.hostPlatform then "$out" else buildPackages.stern;
in
''
2020-04-26 03:16:52 +00:00
for shell in bash zsh; do
${stern}/bin/stern --completion $shell > stern.$shell
installShellCompletion stern.$shell
done
'';
meta = with lib; {
description = "Multi pod and container log tailing for Kubernetes";
homepage = "https://github.com/stern/stern";
license = licenses.asl20;
maintainers = with maintainers; [ mbode preisschild ];
};
2018-10-01 21:56:08 +00:00
}