2023-11-14 09:42:29 +00:00
{ stdenv , lib , buildGoModule , fetchFromGitHub , installShellFiles , testers , nix-update-script , k9s }:
2019-07-27 17:46:08 +01:00
buildGoModule rec {
pname = " k 9 s " ;
2023-12-07 18:19:18 +00:00
version = " 0 . 2 9 . 1 " ;
2019-07-27 17:46:08 +01:00
src = fetchFromGitHub {
2019-09-21 23:40:14 +01:00
owner = " d e r a i l e d " ;
repo = " k 9 s " ;
2020-02-01 18:47:21 +00:00
rev = " v ${ version } " ;
2023-12-07 18:19:18 +00:00
sha256 = " s h a 2 5 6 - a g G a y Z 2 0 R M A c G O x + o w w D b U U D s j F 3 F Z a j h w D Z 5 w t E 9 3 k = " ;
2019-07-27 17:46:08 +01:00
} ;
2021-08-26 07:45:51 +01:00
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 } "
2022-06-28 04:58:39 +01:00
" - 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 "
2021-08-26 07:45:51 +01:00
] ;
2019-10-30 10:16:13 +00:00
2022-06-28 04:58:39 +01:00
tags = [ " n e t g o " ] ;
2019-07-27 17:46:08 +01:00
2023-12-07 18:08:45 +00:00
vendorHash = " s h a 2 5 6 - W n / 9 v I y w 9 9 B u d h h T n o N 8 1 N p 7 0 V I n V 6 u o 7 S r u 6 4 n h P g k = " ;
2021-12-03 13:56:38 +00:00
2022-03-18 03:28:20 +00:00
# TODO investigate why some config tests are failing
doCheck = ! ( stdenv . isDarwin && stdenv . isAarch64 ) ;
2022-06-28 04:58:39 +01:00
# 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"}
2023-11-14 09:42:29 +00:00
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 ;
} ;
updateScript = nix-update-script { } ;
2022-06-28 04:58:39 +01:00
} ;
nativeBuildInputs = [ installShellFiles ] ;
postInstall = ''
installShellCompletion - - cmd k9s \
- - bash < ( $ out/bin/k9s completion bash ) \
- - fish < ( $ out/bin/k9s completion fish ) \
- - zsh < ( $ out/bin/k9s completion zsh )
'' ;
2020-08-04 01:26:27 +01:00
2021-01-11 07:54:33 +00:00
meta = with lib ; {
2020-10-11 06:55:05 +01:00
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 " ;
2020-03-14 07:15:49 +00:00
homepage = " h t t p s : / / g i t h u b . c o m / d e r a i l e d / k 9 s " ;
2019-07-27 17:46:08 +01:00
license = licenses . asl20 ;
2023-05-08 10:02:23 +01:00
maintainers = with maintainers ; [ Gonzih markus1189 bryanasdev000 qjoly ] ;
2019-07-27 17:46:08 +01:00
} ;
2020-07-08 17:16:04 +01:00
}