3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/cluster/stern/default.nix

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";
2021-09-14 04:52:20 +01:00
version = "1.20.1";
2018-10-01 22:56:08 +01:00
src = fetchFromGitHub {
owner = "stern";
2018-10-01 22:56:08 +01:00
repo = "stern";
rev = "v${version}";
2021-09-14 04:52:20 +01:00
sha256 = "sha256-JredVk2hjnhoaJ9bT7D5k35skBNjcEBLa6GgO8dB2+U=";
2018-10-01 22:56:08 +01:00
};
2021-09-14 04:52:20 +01:00
vendorSha256 = "sha256-ybsDB54kkbONi3b9URtNUusHIdUfzymOpYlNHJz4i2A=";
2021-06-30 05:40:51 +01:00
subPackages = [ "." ];
2018-10-01 22:56:08 +01:00
2020-04-26 04:16:52 +01:00
nativeBuildInputs = [ installShellFiles ];
2021-08-26 07:45:51 +01: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 04:16:52 +01: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 22:56:08 +01:00
}