diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/users/shells/bash/default.nix | 43 | ||||
| -rw-r--r-- | modules/users/shells/default.nix | 1 | ||||
| -rw-r--r-- | modules/users/shells/zsh/default.nix | 27 |
3 files changed, 59 insertions, 12 deletions
diff --git a/modules/users/shells/bash/default.nix b/modules/users/shells/bash/default.nix new file mode 100644 index 0000000..d17ffc5 --- /dev/null +++ b/modules/users/shells/bash/default.nix @@ -0,0 +1,43 @@ +{ + config, + pkgs, + lib, + ... +}: + +let + inherit (lib) mkOption mkIf types; + cfg = config.nx.shells.bash; +in +{ + options.nx.shells.bash = { + enable = mkOption { + type = types.bool; + default = config.nx.terminal.defaultShell == "bash"; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + zoxide + ]; + + programs.bash = { + enable = true; + enableCompletion = true; + initExtra = '' + # view man pages with nvim + export MANPAGER="nvim +Man!" + + # vim keybindings + set -o vi + + # zoxide smarter cd command + eval "$(zoxide init bash)" + ''; + shellAliases = { + ls = "ls --color=auto"; + }; + }; + }; +} diff --git a/modules/users/shells/default.nix b/modules/users/shells/default.nix index c3f96c7..9abd804 100644 --- a/modules/users/shells/default.nix +++ b/modules/users/shells/default.nix @@ -2,5 +2,6 @@ { imports = [ ./zsh + ./bash ]; } diff --git a/modules/users/shells/zsh/default.nix b/modules/users/shells/zsh/default.nix index 5a48cf0..0b94c3d 100644 --- a/modules/users/shells/zsh/default.nix +++ b/modules/users/shells/zsh/default.nix @@ -28,20 +28,23 @@ in autosuggestion.enable = true; syntaxHighlighting.enable = true; initContent = '' - # view man pages with nvim - export MANPAGER="nvim +Man!" + # view man pages with nvim + export MANPAGER="nvim +Man!" - # Directory completion with trailing slash - zstyle ':completion:*' list-dirs-first true - zstyle ':completion:*' special-dirs true - zstyle ':completion:*' squeeze-slashes true - zstyle ':completion:*' add-space false + # Directory completion with trailing slash + zstyle ':completion:*' list-dirs-first true + zstyle ':completion:*' special-dirs true + zstyle ':completion:*' squeeze-slashes true + zstyle ':completion:*' add-space false - # Case-insensitive completion - zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' - # vim keybindings - bindkey -v - ''; + # Case-insensitive completion + zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' + # vim keybindings + bindkey -v + + # zoxide smarter cmd command + eval "$(zoxide init zsh)" + ''; shellAliases = { ls = "ls --color=auto"; }; |
