2023-11-14 09:42:29 +00:00
{ stdenv , lib , buildGoModule , fetchFromGitHub , installShellFiles , testers , nix-update-script , k9s }:
2019-07-27 16:46:08 +00:00
buildGoModule rec {
pname = " k 9 s " ;
2024-11-15 18:02:38 +00:00
version = " 0 . 3 2 . 6 " ;
2019-07-27 16:46:08 +00:00
src = fetchFromGitHub {
2023-12-19 07:40:09 +00:00
owner = " d e r a i l e d " ;
repo = " k 9 s " ;
rev = " v ${ version } " ;
2024-11-15 18:02:38 +00:00
hash = " s h a 2 5 6 - j J H l F r n y v G Z 0 / y k m Z R b S A F w z v N 0 j 2 d q d d L E Q o i v 3 o y s = " ;
2019-07-27 16:46:08 +00:00
} ;
2021-08-26 06:45:51 +00:00
ldflags = [
2023-12-19 07:40:09 +00:00
" - s "
" - w "
2021-08-26 06:45:51 +00: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 . 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 03:58:39 +00: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 06:45:51 +00:00
] ;
2019-10-30 10:16:13 +00:00
2024-07-22 09:24:14 +00:00
tags = [ " n e t c g o " ] ;
2019-07-27 16:46:08 +00:00
2023-12-19 07:39:54 +00:00
proxyVendor = true ;
2024-11-15 18:02:38 +00:00
vendorHash = " s h a 2 5 6 - / D V Q g h w f i P K L O 0 L F P F m H F O 5 j f A c t o E n l M u Q P 2 i 6 0 R 9 o = " ;
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 . hostPlatform . isDarwin && stdenv . hostPlatform . isAarch64 ) ;
2022-06-28 03:58:39 +00: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 03:58:39 +00:00
} ;
nativeBuildInputs = [ installShellFiles ] ;
postInstall = ''
2024-02-02 16:03:17 +00:00
# k9s requires a writeable log directory
# Otherwise an error message is printed
# into the completion scripts
export K9S_LOGS_DIR = $ ( mktemp - d )
2022-06-28 03:58:39 +00:00
installShellCompletion - - cmd k9s \
- - bash < ( $ out/bin/k9s completion bash ) \
- - fish < ( $ out/bin/k9s completion fish ) \
- - zsh < ( $ out/bin/k9s completion zsh )
'' ;
2020-08-04 00:26:27 +00:00
2021-01-11 07:54:33 +00:00
meta = with lib ; {
2020-10-11 05:55:05 +00: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 " ;
2023-12-24 08:24:39 +00:00
changelog = " 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 / r e l e a s e s / t a g / v ${ version } " ;
2019-07-27 16:46:08 +00:00
license = licenses . asl20 ;
2023-12-24 08:24:39 +00:00
mainProgram = " k 9 s " ;
2023-05-08 09:02:23 +00:00
maintainers = with maintainers ; [ Gonzih markus1189 bryanasdev000 qjoly ] ;
2019-07-27 16:46:08 +00:00
} ;
2020-07-08 16:16:04 +00:00
}