@ -1,28 +1,46 @@
{ stdenv , lib , buildGoModule , fetchFromGitHub }:
{ stdenv , lib , buildGoModule , fetchFromGitHub , installShellFiles , testers , k9s }:
buildGoModule rec {
pname = " k 9 s " ;
version = " 0 . 2 5 . 1 8 " ;
version = " 0 . 2 5 . 2 1 " ;
src = fetchFromGitHub {
owner = " d e r a i l e d " ;
repo = " k 9 s " ;
rev = " v ${ version } " ;
sha256 = " s h a 2 5 6 - i U h M P t F X 7 q F U L e g i y h l T 4 a G 9 q 3 d e Z 8 a R q y E c b Z 9 j Y / s = " ;
sha256 = " s h a 2 5 6 - z i I M T M K 6 G 8 v X j e 6 G W P v c I W m l u b q 7 5 X V r J U z Z l A + R 0 R c = " ;
} ;
ldflags = [
" - s " " - w "
" - X g i t h u b . c o m / d e r a i l e d / k 9 s / c m d . v e r s i o n = ${ version } "
" - X g i t h u b . c o m / d e r a i l e d / k 9 s / c m d . c o m m i t = ${ src . rev } "
" - X g i t h u b . c o m / d e r a i l e d / k 9 s / c m d . d a t e = 1 9 7 0 - 0 1 - 0 1 T 0 0 : 0 0 : 0 0 Z "
] ;
vendorSha256 = " s h a 2 5 6 - m M o b 7 M 9 R Q l q a V K 0 D g H p a A K 9 d 1 b t z f Q e t n l i U q F T v j J Q = " ;
tags = [ " n e t g o " ] ;
preCheck = " e x p o r t H O M E = $ ( m k t e m p - d ) " ;
vendorSha256 = " s h a 2 5 6 - w L 8 U n h t / Z R A G D u C / U 4 S F V 5 P d E x y 7 8 F 4 D M y M 8 + 7 C M t O Y = " ;
# TODO investigate why some config tests are failing
doCheck = ! ( stdenv . isDarwin && stdenv . isAarch64 ) ;
# Required to workaround test check error:
preCheck = " e x p o r t H O M E = $ ( m k t e m p - d ) " ;
# For arch != x86
# {"level":"fatal","error":"could not create any of the following paths: /homeless-shelter/.config, /etc/xdg","time":"2022-06-28T15:52:36Z","message":"Unable to create configuration directory for k9s"}
passthru . tests . version = testers . testVersion {
package = k9s ;
command = " H O M E = $ ( m k t e m p - d ) k 9 s v e r s i o n - s " ;
inherit version ;
} ;
nativeBuildInputs = [ installShellFiles ] ;
postInstall = ''
installShellCompletion - - cmd k9s \
- - bash < ( $ out/bin/k9s completion bash ) \
- - fish < ( $ out/bin/k9s completion fish ) \
- - zsh < ( $ out/bin/k9s completion zsh )
'' ;
meta = with lib ; {
description = " K u b e r n e t e s C L I T o M a n a g e Y o u r C l u s t e r s I n S t y l e " ;