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-24 08:17:56 +00:00
version = " 0 . 3 0 . 0 " ;
2019-07-27 17:46:08 +01: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 } " ;
2023-12-24 08:17:56 +00:00
hash = " s h a 2 5 6 - E S f 1 B o Q 3 D A z 0 z 5 J / 2 P e X 3 V q 8 V 3 o 8 7 s K i 7 c 1 2 5 0 g D G q k = " ;
2019-07-27 17:46:08 +01:00
} ;
2021-08-26 07:45:51 +01:00
ldflags = [
2023-12-19 07:40:09 +00:00
" - s "
" - w "
2021-08-26 07:45:51 +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 . 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-19 07:39:54 +00:00
proxyVendor = true ;
2023-12-24 08:17:56 +00:00
vendorHash = " s h a 2 5 6 - A 8 k q M w R M l 1 J d o n z 9 I i 7 9 p v w A 8 R K g 8 + 7 X V e 1 V l P B V h F A = " ;
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
}