From 54f6a84162a29e3698db1f634b19ecad4e4d5e2d Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Wed, 4 Dec 2024 21:10:00 -0600 Subject: [PATCH] update/rearrange shell-related configurations --- home/modules/tui/default.nix | 3 +-- home/modules/tui/extras/default.nix | 1 - home/modules/tui/extras/direnv.nix | 6 ----- home/modules/tui/eza.nix | 9 ------- home/modules/tui/fish/abbrs.nix | 20 --------------- home/modules/tui/fish/aliases.nix | 6 ----- home/modules/tui/fish/default.nix | 12 --------- home/modules/tui/shell/aliases.nix | 15 +++++++++++ home/modules/tui/shell/default.nix | 24 ++++++++++++++++++ home/modules/tui/shell/eza.nix | 17 +++++++++++++ home/modules/tui/shell/fish/abbrs.nix | 10 ++++++++ home/modules/tui/shell/fish/default.nix | 25 +++++++++++++++++++ .../tui/{ => shell}/fish/functions.nix | 2 +- .../tui/{ => shell}/fish/shell-init.nix | 3 ++- 14 files changed, 95 insertions(+), 58 deletions(-) delete mode 100644 home/modules/tui/extras/direnv.nix delete mode 100644 home/modules/tui/eza.nix delete mode 100644 home/modules/tui/fish/abbrs.nix delete mode 100644 home/modules/tui/fish/aliases.nix delete mode 100644 home/modules/tui/fish/default.nix create mode 100644 home/modules/tui/shell/aliases.nix create mode 100644 home/modules/tui/shell/default.nix create mode 100644 home/modules/tui/shell/eza.nix create mode 100644 home/modules/tui/shell/fish/abbrs.nix create mode 100644 home/modules/tui/shell/fish/default.nix rename home/modules/tui/{ => shell}/fish/functions.nix (99%) rename home/modules/tui/{ => shell}/fish/shell-init.nix (95%) diff --git a/home/modules/tui/default.nix b/home/modules/tui/default.nix index b57735d..c99e02a 100644 --- a/home/modules/tui/default.nix +++ b/home/modules/tui/default.nix @@ -2,9 +2,8 @@ # Core CLI apps imports = [ - ./eza.nix ./git.nix - ./fish + ./shell ./nix-index.nix ./neovim ./tmux.nix diff --git a/home/modules/tui/extras/default.nix b/home/modules/tui/extras/default.nix index e985bc6..4dc3739 100644 --- a/home/modules/tui/extras/default.nix +++ b/home/modules/tui/extras/default.nix @@ -3,7 +3,6 @@ imports = [ ../default.nix - ./direnv.nix ./go.nix ]; diff --git a/home/modules/tui/extras/direnv.nix b/home/modules/tui/extras/direnv.nix deleted file mode 100644 index 99895e3..0000000 --- a/home/modules/tui/extras/direnv.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; -} \ No newline at end of file diff --git a/home/modules/tui/eza.nix b/home/modules/tui/eza.nix deleted file mode 100644 index c1ff333..0000000 --- a/home/modules/tui/eza.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ lib, ... }: { - programs.eza = { - enable = true; - extraOptions = [ - "--group-directories-first" - ]; - git = true; - }; -} \ No newline at end of file diff --git a/home/modules/tui/fish/abbrs.nix b/home/modules/tui/fish/abbrs.nix deleted file mode 100644 index f2adf97..0000000 --- a/home/modules/tui/fish/abbrs.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - programs.fish.shellAbbrs = rec { - ccat = "egrep -v '^\s*(#|\\$)'"; - dnsplan = "dnscontrol preview"; - dnspush = "dnscontrol push"; - g = "git"; - ga = "git add"; - gc = "git commit -S"; # interactive commit - gcm = "git commit -S -m"; # quick commit - gg = "git graph"; - gs = "git status"; - jqless = "jq -C | less -r"; - n = "nix"; - sshpass = "ssh -o PubkeyAuthentication=no"; - tf = "terraform"; - tfyolo = "terraform apply -auto-approve"; - v = "vim"; - vi = "vim"; - }; -} \ No newline at end of file diff --git a/home/modules/tui/fish/aliases.nix b/home/modules/tui/fish/aliases.nix deleted file mode 100644 index ee23b1b..0000000 --- a/home/modules/tui/fish/aliases.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.fish.shellAliases = { - cat = "bat"; - top = "btop"; - }; -} \ No newline at end of file diff --git a/home/modules/tui/fish/default.nix b/home/modules/tui/fish/default.nix deleted file mode 100644 index 963abdd..0000000 --- a/home/modules/tui/fish/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - imports = [ - ./abbrs.nix - ./aliases.nix - ./functions.nix - ./shell-init.nix - ]; - - programs.fish = { - enable = true; - }; -} diff --git a/home/modules/tui/shell/aliases.nix b/home/modules/tui/shell/aliases.nix new file mode 100644 index 0000000..1eafb56 --- /dev/null +++ b/home/modules/tui/shell/aliases.nix @@ -0,0 +1,15 @@ +{ + cat = "bat"; + ccat = "egrep -v '^\s*(#|\\$)'"; + g = "git"; + gg = "git graph"; + gs = "git status"; + jqless = "jq -C | less -r"; + n = "nix"; + sshpass = "ssh -o PubkeyAuthentication=no"; + tf = "terraform"; + tfyolo = "terraform apply -auto-approve"; + top = "btop"; + v = "vim"; + vi = "vim"; +} \ No newline at end of file diff --git a/home/modules/tui/shell/default.nix b/home/modules/tui/shell/default.nix new file mode 100644 index 0000000..743329c --- /dev/null +++ b/home/modules/tui/shell/default.nix @@ -0,0 +1,24 @@ +{ + imports = [ + ./eza.nix + ./fish + ]; + + home = { + shellAliases = import ./aliases.nix; + }; + + programs = { + zoxide = { + enable = true; + options = ["--cmd" "j"]; + }; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + fzf.enable = true; + }; +} diff --git a/home/modules/tui/shell/eza.nix b/home/modules/tui/shell/eza.nix new file mode 100644 index 0000000..5cdcc05 --- /dev/null +++ b/home/modules/tui/shell/eza.nix @@ -0,0 +1,17 @@ +{ + programs.eza = { + enable = true; + enableFishIntegration = false; + extraOptions = [ + "--group-directories-first" + ]; + git = true; + }; + + home.shellAliases = { + ls = "eza"; + l = "eza -lhg"; + ll = "eza -alhg"; + lt = "eza --tree"; + }; +} \ No newline at end of file diff --git a/home/modules/tui/shell/fish/abbrs.nix b/home/modules/tui/shell/fish/abbrs.nix new file mode 100644 index 0000000..fd80d0a --- /dev/null +++ b/home/modules/tui/shell/fish/abbrs.nix @@ -0,0 +1,10 @@ +{ + programs.fish.shellAbbrs = rec { + "-" = "prevd"; + dnsplan = "dnscontrol preview"; + dnspush = "dnscontrol push"; + ga = "git add"; + gc = "git commit -S"; + gcm = "git commit -S -m"; + }; +} \ No newline at end of file diff --git a/home/modules/tui/shell/fish/default.nix b/home/modules/tui/shell/fish/default.nix new file mode 100644 index 0000000..25d1bb0 --- /dev/null +++ b/home/modules/tui/shell/fish/default.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: { + imports = [ + ./abbrs.nix + ./functions.nix + ./shell-init.nix + ]; + + programs = { + fish = { + enable = true; + + plugins = [ + { + name = "plugin-git"; + src = pkgs.fishPlugins.plugin-git.src; + } + { + name = "bass"; + src = pkgs.fishPlugins.bass.src; + } + ]; + }; + + }; +} \ No newline at end of file diff --git a/home/modules/tui/fish/functions.nix b/home/modules/tui/shell/fish/functions.nix similarity index 99% rename from home/modules/tui/fish/functions.nix rename to home/modules/tui/shell/fish/functions.nix index 9c1b44f..5ae9843 100644 --- a/home/modules/tui/fish/functions.nix +++ b/home/modules/tui/shell/fish/functions.nix @@ -69,7 +69,7 @@ # nix-shell set -l nix ( if test -n "$IN_NIX_SHELL" - echo -n "[nix]" + echo -n "❄" end ) diff --git a/home/modules/tui/fish/shell-init.nix b/home/modules/tui/shell/fish/shell-init.nix similarity index 95% rename from home/modules/tui/fish/shell-init.nix rename to home/modules/tui/shell/fish/shell-init.nix index e591aaa..7cf4112 100644 --- a/home/modules/tui/fish/shell-init.nix +++ b/home/modules/tui/shell/fish/shell-init.nix @@ -14,8 +14,9 @@ '' fish_vi_key_bindings set fish_cursor_default block - set fish_cursor_insert block blink + set fish_cursor_insert line blink set fish_cursor_replace_one underscore blink + set fish_cursor_replace underscore blink set fish_cursor_visual block '' + # Restore ctrl+f to accept suggestions