1 { stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, nix-update-script, k9s }:
7 src = fetchFromGitHub {
11 hash = "sha256-H0PimkPXs2/iirOpN82az3Bge71k1RZOhMtr0UmGOy8=";
17 "-X github.com/derailed/k9s/cmd.version=${version}"
18 "-X github.com/derailed/k9s/cmd.commit=${src.rev}"
19 "-X github.com/derailed/k9s/cmd.date=1970-01-01T00:00:00Z"
26 vendorHash = "sha256-U/tIsYpoog3S8V2yQGGqaQ+Av7TfvCYt3zn74qWuQKs=";
28 # TODO investigate why some config tests are failing
29 doCheck = !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64);
30 # Required to workaround test check error:
31 preCheck = "export HOME=$(mktemp -d)";
33 # {"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"}
35 tests.version = testers.testVersion {
37 command = "HOME=$(mktemp -d) k9s version -s";
40 updateScript = nix-update-script { };
43 nativeBuildInputs = [ installShellFiles ];
45 # k9s requires a writeable log directory
46 # Otherwise an error message is printed
47 # into the completion scripts
48 export K9S_LOGS_DIR=$(mktemp -d)
50 installShellCompletion --cmd k9s \
51 --bash <($out/bin/k9s completion bash) \
52 --fish <($out/bin/k9s completion fish) \
53 --zsh <($out/bin/k9s completion zsh)
57 description = "Kubernetes CLI To Manage Your Clusters In Style";
58 homepage = "https://github.com/derailed/k9s";
59 changelog = "https://github.com/derailed/k9s/releases/tag/v${version}";
60 license = licenses.asl20;
62 maintainers = with maintainers; [ Gonzih markus1189 bryanasdev000 qjoly ];