2020-04-26 04:16:52 +01:00
|
|
|
{ stdenv, lib, buildPackages, buildGoPackage, fetchFromGitHub, installShellFiles }:
|
2018-11-27 01:35:48 +00:00
|
|
|
|
|
|
|
let isCrossBuild = stdenv.hostPlatform != stdenv.buildPlatform; in
|
2018-10-01 22:56:08 +01:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "stern";
|
2019-07-09 08:13:29 +01:00
|
|
|
version = "1.11.0";
|
2018-10-01 22:56:08 +01:00
|
|
|
|
|
|
|
goPackagePath = "github.com/wercker/stern";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wercker";
|
|
|
|
repo = "stern";
|
2019-09-09 00:38:31 +01:00
|
|
|
rev = version;
|
2019-07-09 08:13:29 +01:00
|
|
|
sha256 = "0xndlq0ks8flzx6rdd4lnkxpkbvdy9sj1jwys5yj7p989ls8by3n";
|
2018-10-01 22:56:08 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
goDeps = ./deps.nix;
|
|
|
|
|
2020-04-26 04:16:52 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2018-11-27 01:35:48 +00:00
|
|
|
postInstall =
|
2020-04-28 02:50:57 +01:00
|
|
|
let stern = if isCrossBuild then buildPackages.stern else "$out"; in
|
2018-11-27 01:35:48 +00:00
|
|
|
''
|
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
|
2018-11-27 01:35:48 +00:00
|
|
|
'';
|
2018-11-26 19:41:04 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Multi pod and container log tailing for Kubernetes";
|
|
|
|
homepage = "https://github.com/wercker/stern";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ mbode ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2018-10-01 22:56:08 +01:00
|
|
|
}
|