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.

43 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv, lib, buildPackages, buildGoModule, fetchFromGitHub, installShellFiles }:
let isCrossBuild = stdenv.hostPlatform != stdenv.buildPlatform;
in
buildGoModule rec {
pname = "stern";
2022-02-02 01:54:49 +00:00
version = "1.21.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}";
2022-02-02 01:54:49 +00:00
sha256 = "sha256-+V0mRSjAwhZoiIS/OpZyqa5rvlqU9pGJwmW0QZ3H2g4=";
2018-10-01 21:56:08 +00:00
};
2022-02-02 01:54:49 +00:00
vendorSha256 = "sha256-IPHu23/2e6406FELB1Mwegp0C16cFD65mbW5Ah32D4Q=";
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 ];
2021-08-26 06:45:51 +00:00
ldflags =
[ "-s" "-w" "-X github.com/stern/stern/cmd.version=${version}" ];
postInstall =
let stern = if isCrossBuild then buildPackages.stern else "$out";
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 ];
platforms = platforms.unix;
};
2018-10-01 21:56:08 +00:00
}