1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/applications/networking/cluster/stern/default.nix

41 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-02-06 20:02:47 +00:00
version = "1.14.0";
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-02-06 20:02:47 +00:00
sha256 = "sha256-8l/Tr+IxR3yPmt9hI70XuUQ4YEYzRTMLbo8BsngoU60=";
2018-10-01 22:56:08 +01:00
};
2021-02-06 20:02:47 +00:00
vendorSha256 = "sha256-pvFT4A7bDBvBf1odyv3z4inw1/IsvOA+++OPbfNjzxM=";
2018-10-01 22:56:08 +01:00
2020-04-26 04:16:52 +01:00
nativeBuildInputs = [ installShellFiles ];
buildFlagsArray =
[ "-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
}