diff --git a/home/features/cli/extras/default.nix b/home/features/cli/extras/default.nix index 4c8ed8b..3332a57 100644 --- a/home/features/cli/extras/default.nix +++ b/home/features/cli/extras/default.nix @@ -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 diff --git a/home/features/cli/fish.nix b/home/features/cli/fish.nix index 7acc730..8d001df 100644 --- a/home/features/cli/fish.nix +++ b/home/features/cli/fish.nix @@ -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";