init cli, add start of target docs

This commit is contained in:
Bryton Hall 2022-08-12 09:44:00 -04:00
parent d41bceaa4c
commit 612fa7d53c
3 changed files with 81 additions and 14 deletions

60
pkgs/kubenix.nix Normal file
View file

@ -0,0 +1,60 @@
{
lib,
writeShellScriptBin,
coreutils,
nix,
jq,
}: let
name = "kubenix";
in
lib.recursiveUpdate
(writeShellScriptBin name ''
set -Eeuo pipefail
NAME=${name}
function help() {
echo "
kubenix - Kubernetes resource management with Nix
commands:
apply - create resources in target cluster
render - print resource manifests to stdout
"
}
function apply() {
echo not impremented
}
function render() {
${nix}/bin/nix eval '.#kubernetes' # | ${jq}/bin/jq 'fromjson'
}
while test $# -gt 0; do
case "$1" in
apply|"")
shift
apply
;;
render)
shift
render
;;
-h|--help)
help
exit 0
;;
-v|--verbose)
shift
set -x
;;
*)
help
exit 1
;;
esac
done
'')
{meta.description = "";}