From 1d9f48f5d3bab732bb315ecc9b904653d4d401bf Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 21 Jun 2022 08:33:05 -0400 Subject: [PATCH] separate kubernetes and terraform fish abbrs --- hosts/macbook/default.nix | 1 + modules/darwin/tmux.nix | 6 ++++++ modules/programming/kubernetes.nix | 18 ++++++++++++++++++ modules/programming/terraform.nix | 17 ++++++++++++----- modules/shell/fish/default.nix | 20 ++++---------------- 5 files changed, 41 insertions(+), 21 deletions(-) create mode 100644 modules/programming/kubernetes.nix diff --git a/hosts/macbook/default.nix b/hosts/macbook/default.nix index 487c67f..0404a62 100644 --- a/hosts/macbook/default.nix +++ b/hosts/macbook/default.nix @@ -20,5 +20,6 @@ darwin.lib.darwinSystem { ../../modules/programming/nix.nix ../../modules/programming/terraform.nix ../../modules/programming/lua.nix + ../../modules/programming/kubernetes.nix ]; } diff --git a/modules/darwin/tmux.nix b/modules/darwin/tmux.nix index 0c40455..16372e2 100644 --- a/modules/darwin/tmux.nix +++ b/modules/darwin/tmux.nix @@ -120,6 +120,12 @@ ]; }; + programs.fish.shellAbbrs = { + ta = "tmux attach-session"; + tan = "tmux attach-session -t noah"; + tnn = "tmux new-session -s noah"; + }; + }; } diff --git a/modules/programming/kubernetes.nix b/modules/programming/kubernetes.nix new file mode 100644 index 0000000..c233e47 --- /dev/null +++ b/modules/programming/kubernetes.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: { + + home-manager.users.${config.user} = { + + home.packages = with pkgs; [ kubectl k9s ]; + + programs.fish.shellAbbrs = { + k = "kubectl"; + pods = "kubectl get pods -A"; + nodes = "kubectl get nodes"; + deploys = "kubectl get deployments -A"; + dash = "kube-dashboard"; + ks = "k9s"; + }; + + }; + +} diff --git a/modules/programming/terraform.nix b/modules/programming/terraform.nix index 2f3be3c..28db982 100644 --- a/modules/programming/terraform.nix +++ b/modules/programming/terraform.nix @@ -1,9 +1,16 @@ { config, pkgs, ... }: { - home-manager.users.${config.user}.home.packages = with pkgs; [ - terraform # Terraform executable - terraform-ls # Language server - tflint # Linter - ]; + home-manager.users.${config.user} = { + programs.fish.shellAbbrs = { + # Terraform + te = "terraform"; + }; + home.packages = with pkgs; [ + terraform # Terraform executable + terraform-ls # Language server + tflint # Linter + ]; + + }; } diff --git a/modules/shell/fish/default.nix b/modules/shell/fish/default.nix index bec278a..1af53e7 100644 --- a/modules/shell/fish/default.nix +++ b/modules/shell/fish/default.nix @@ -71,6 +71,7 @@ set -g fish_cursor_insert line set -g fish_cursor_visual block set -g fish_cursor_replace_one underscore + set -x DIRENV_LOG_FORMAT "" ''; loginShellInit = ""; shellAliases = { }; @@ -91,11 +92,6 @@ scs = "systemctl status"; m = "make"; - # Tmux - ta = "tmux attach-session"; - tan = "tmux attach-session -t noah"; - tnn = "tmux new-session -s noah"; - # Vim (overwritten by Neovim) v = "vim"; vl = "vim -c 'normal! `0'"; @@ -114,22 +110,14 @@ publickey = "ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub"; forloop = "for i in (seq 1 100)"; + # Nix + ns = "nix-shell -p"; + # Docker dc = "$DOTS/bin/docker_cleanup"; dr = "docker run --rm -it"; db = "docker build . -t"; - # Terraform - te = "terraform"; - - # Kubernetes - k = "kubectl"; - pods = "kubectl get pods -A"; - nodes = "kubectl get nodes"; - deploys = "kubectl get deployments -A"; - dash = "kube-dashboard"; - ks = "k9s"; - # Python py = "python"; po = "poetry";