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-06-19 22:34:09 +00:00
version = " 0 . 3 2 . 5 " ;
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-06-19 22:34:09 +00:00
hash = " s h a 2 5 6 - H 0 P i m k P X s 2 / i i r O p N 8 2 a z 3 B g e 7 1 k 1 R Z O h M t r 0 U m G O y 8 = " ;
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-06-19 22:34:09 +00:00
vendorHash = " s h a 2 5 6 - U / t I s Y p o o g 3 S 8 V 2 y Q G G q a Q + A v 7 T f v C Y t 3 z n 7 4 q W u Q K s = " ;
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
}