add kubectl / make 'k' abbr conditional

This commit is contained in:
John Bowdre 2023-08-04 14:20:13 -05:00
parent e67aea353a
commit 67e83165f9
2 changed files with 9 additions and 2 deletions

View file

@ -11,6 +11,7 @@
awscli # AWS CLI
google-cloud-sdk # GCP CLI
hugo # Static site generator
kubectl # Container wrangler
nil # Nix LSP
# nix-inspect # See which pkgs are in your Path
nixfmt # Nix formatter

View file

@ -1,11 +1,17 @@
{ pkgs, lib, config, ... }: {
{ pkgs, lib, config, ... }:
let
inherit (lib) mkIf;
hasPackage = pname: lib.any (p: p ? pname && p.name == pname) config.home.packages;
hasKubectl = hasPackage "kubectl";
in
{
programs.fish = {
enable = true;
shellAbbrs = rec {
ccat = "egrep -v '^\s*(#|$)'";
jqless = "jq -C | less -r";
k = "kubectl";
k = mkIf hasKubectl "kubectl";
n = "nix";
sshpass = "ssh -o PubkeyAuthentication=no";
tf = "terraform";