main
1# https://github.com/chmouel/chmouzies/tree/master/kubernetes
2{
3 stdenv,
4 lib,
5 fetchFromGitLab,
6 python313,
7 installShellFiles,
8}:
9
10stdenv.mkDerivation {
11 pname = "chmouzies-kubernetes";
12 version = "0-unstable-2026-04-14";
13
14 src = fetchFromGitLab {
15 owner = "chmouel";
16 repo = "chmouzies";
17 rev = "99b02ddf55c76b667e670e63e9ea303986d49cc7";
18 hash = "sha256-hXjAkF0JmrVr0GoCj07eFiSMKVnC0+PpKTcyx6IwNmk=";
19 };
20
21 propagatedBuildInputs = [ python313 ];
22 nativeBuildInputs = [ installShellFiles ];
23
24 installPhase =
25 let
26 binaries = [
27 "ocla"
28 "kcl"
29 "kdd"
30 "kdp"
31 "kselect"
32 "kubectl-get-secret"
33 ];
34 in
35 ''
36 runHook preInstall
37
38 mkdir -p $out/bin
39 ${lib.concatMapStringsSep "\n" (b: "cp $src/kubernetes/${b} $out/bin/") binaries}
40
41 installShellCompletion --cmd kcl --zsh $src/kubernetes/_kcl
42 installShellCompletion --cmd kdd --zsh $src/kubernetes/_kdd
43 installShellCompletion --cmd kdp --zsh $src/kubernetes/_kdp
44 installShellCompletion --cmd kselect --zsh $src/kubernetes/_kselect
45 installShellCompletion --cmd ocla --zsh $src/kubernetes/_ocla
46
47 runHook postInstall
48 '';
49
50 meta = {
51 description = "Chmouel's Kubernetes and OpenShift helper scripts";
52 homepage = "https://gitlab.com/chmouel/chmouzies";
53 platforms = lib.platforms.unix;
54 };
55}