diff --git a/pkgs/applications/networking/cluster/kns/default.nix b/pkgs/applications/networking/cluster/kns/default.nix new file mode 100644 index 000000000000..522209d59183 --- /dev/null +++ b/pkgs/applications/networking/cluster/kns/default.nix @@ -0,0 +1,38 @@ +{ stdenvNoCC +, lib +, fetchFromGitHub +, fzf +, kubectl +}: +stdenvNoCC.mkDerivation { + pname = "kns"; + version = "unstable-2023-04-25"; + + src = fetchFromGitHub { + owner = "blendle"; + repo = "kns"; + rev = "86502949c31432bd95895cfb26d1c5893c533d5c"; + hash = "sha256-8AR/fEKPAfiKCZrp/AyJo3Ic8dH7SfncYZSdQA2GywQ="; + }; + + strictDeps = true; + + buildInputs = [ fzf kubectl ]; + + installPhase = '' + runHook preInstall + + substituteInPlace bin/kns bin/ktx --replace fzf ${fzf}/bin/fzf --replace kubectl ${kubectl}/bin/kubectl + install -D -m755 -t $out/bin bin/kns bin/ktx + + runHook postInstall + ''; + + meta = with lib; { + description = "Kubernetes namespace switcher"; + homepage = "https://github.com/blendle/kns"; + license = licenses.isc; + maintainers = with maintainers; [ mmlb ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f78fa15ee7b4..6c8d167c7f3a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33115,6 +33115,8 @@ with pkgs; kn = callPackage ../applications/networking/cluster/kn { }; + kns = callPackage ../applications/networking/cluster/kns { }; + kondo = callPackage ../applications/misc/kondo { }; kooha = callPackage ../applications/video/kooha { };