diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2025-09-05 13:38:29 -0500 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2025-09-05 13:38:29 -0500 |
| commit | 9497b67ef9e6f397ba146cc4c12fec8e9ecae7b2 (patch) | |
| tree | ca7572e556a0653be8c2c1e1f80da6f147249702 | |
| parent | ce7493a36431965d44e6c538a831c1200bedc0bc (diff) | |
allow same configurations for fish in bash
| -rw-r--r-- | modules/terminal/options.nix | 6 | ||||
| -rw-r--r-- | modules/terminal/system/programs/bash.nix | 32 | ||||
| -rw-r--r-- | modules/terminal/system/programs/bat.nix | 17 | ||||
| -rw-r--r-- | modules/terminal/system/programs/broot.nix | 27 | ||||
| -rw-r--r-- | modules/terminal/system/programs/eza.nix | 17 | ||||
| -rw-r--r-- | modules/terminal/system/programs/fish.nix | 22 | ||||
| -rw-r--r-- | modules/terminal/system/programs/fzf.nix | 17 | ||||
| -rw-r--r-- | modules/terminal/system/programs/helix.nix | 25 | ||||
| -rw-r--r-- | modules/terminal/system/programs/starship.nix | 35 | ||||
| -rw-r--r-- | modules/terminal/system/programs/tmux.nix | 1 |
10 files changed, 137 insertions, 62 deletions
diff --git a/modules/terminal/options.nix b/modules/terminal/options.nix index f7510d0..8799c0b 100644 --- a/modules/terminal/options.nix +++ b/modules/terminal/options.nix @@ -25,11 +25,9 @@ in { default = let cfg = config.collinux.terminal.shells; in - if (cfg.fish.enable && !cfg.bash.enable) + if cfg.fish.enable then pkgs.fish - else if (!cfg.fish.enable && cfg.bash.enable) - then pkgs.bash - else null; + else pkgs.bash; }; }; diff --git a/modules/terminal/system/programs/bash.nix b/modules/terminal/system/programs/bash.nix new file mode 100644 index 0000000..ed2c226 --- /dev/null +++ b/modules/terminal/system/programs/bash.nix @@ -0,0 +1,32 @@ +{ + pkgs, + config, + lib, + ... +}: let + cfg = config.collinux.terminal.shells.bash; +in + lib.mkIf cfg.enable { + hjem.users."${config.collinux.user.name}" = { + files = { + ".bashrc".text = '' + eval "$(direnv hook bash)" + + for file in ~/.config/bash/conf.d/*; do source "$file"; done + ''; + + packages = with pkgs; [ + fish + ripgrep + fd + moreutils + zip + unzip + btop + jq + direnv + pay-respects + ]; + }; + }; + } diff --git a/modules/terminal/system/programs/bat.nix b/modules/terminal/system/programs/bat.nix index 6f53dd7..d954291 100644 --- a/modules/terminal/system/programs/bat.nix +++ b/modules/terminal/system/programs/bat.nix @@ -8,10 +8,19 @@ in lib.mkIf cfg.enable { hjem.users."${config.collinux.user.name}" = { - files.".config/fish/conf.d/bat.fish".text = '' - alias cat bat - set -gx BAT_THEME "base16" - ''; + files = + (lib.optionalAttrs config.collinux.terminal.shells.fish.enable { + ".config/fish/conf.d/bat.fish".text = '' + alias cat bat + set -gx BAT_THEME "base16" + ''; + }) + // (lib.optionalAttrs config.collinux.terminal.shells.bash.enable { + ".config/fish/conf.d/bat.bash".text = '' + alias cat="bat" + export BAT_THEME="base16" + ''; + }); packages = [pkgs.bat]; }; diff --git a/modules/terminal/system/programs/broot.nix b/modules/terminal/system/programs/broot.nix index b2060d8..6164044 100644 --- a/modules/terminal/system/programs/broot.nix +++ b/modules/terminal/system/programs/broot.nix @@ -115,16 +115,23 @@ in lib.mkIf cfg.enable { hjem.users."${config.collinux.user.name}" = { - files = { - ".config/broot/conf.toml" = { - generator = (pkgs.formats.toml {}).generate "conf.toml"; - value = conf; - }; - - ".config/fish/conf.d/broot.fish".text = lib.mkIf config.collinux.terminal.shells.fish.enable '' - ${pkgs.broot}/bin/broot --print-shell-function fish | source - ''; - }; + files = + { + ".config/broot/conf.toml" = { + generator = (pkgs.formats.toml {}).generate "conf.toml"; + value = conf; + }; + } + // (lib.optionalAttrs config.collinux.terminal.shells.fish.enable { + ".config/fish/conf.d/broot.fish".text = '' + broot --print-shell-function fish | source + ''; + }) + // (lib.optionalAttrs config.collinux.terminal.shells.bash.enable { + ".config/bash/conf.d/broot.bash".text = '' + eval "$(broot --print-shell-function bash)" + ''; + }); packages = [pkgs.broot]; }; diff --git a/modules/terminal/system/programs/eza.nix b/modules/terminal/system/programs/eza.nix index 52c290d..acdcbc2 100644 --- a/modules/terminal/system/programs/eza.nix +++ b/modules/terminal/system/programs/eza.nix @@ -8,10 +8,19 @@ in lib.mkIf cfg.enable { hjem.users."${config.collinux.user.name}" = { - files.".config/fish/conf.d/eza.fish".text = '' - alias ls "eza -A -w 80 --group-directories-first -I '.git*'" - alias tree "eza -T" - ''; + files = + (lib.optionalAttrs config.collinux.terminal.shells.fish.enable { + ".config/fish/conf.d/eza.fish".text = '' + alias ls "eza -A -w 80 --group-directories-first -I '.git*'" + alias tree "eza -T" + ''; + }) + // (lib.optionalAttrs config.collinux.terminal.shells.fish.enable { + ".config/bash/conf.d/eza.bash".text = '' + alias ls="eza -A -w 80 --group-directories-first -I '.git*'" + alias tree="eza -T" + ''; + }); packages = [pkgs.eza]; }; diff --git a/modules/terminal/system/programs/fish.nix b/modules/terminal/system/programs/fish.nix index fe3ff88..a210cd5 100644 --- a/modules/terminal/system/programs/fish.nix +++ b/modules/terminal/system/programs/fish.nix @@ -5,22 +5,20 @@ ... }: let cfg = config.collinux.terminal.shells.fish; - - init = '' - set fish_greeting - - function fish_title - echo fish (prompt_pwd) - end - - direnv hook fish | source - pay-respects fish --alias | source - ''; in lib.mkIf cfg.enable { hjem.users."${config.collinux.user.name}" = { files = { - ".config/fish/config.fish".text = init; + ".config/fish/config.fish".text = '' + set fish_greeting + + function fish_title + echo fish (prompt_pwd) + end + + direnv hook fish | source + pay-respects fish --alias | source + ''; }; packages = with pkgs; [ diff --git a/modules/terminal/system/programs/fzf.nix b/modules/terminal/system/programs/fzf.nix index 486d4e2..fd86566 100644 --- a/modules/terminal/system/programs/fzf.nix +++ b/modules/terminal/system/programs/fzf.nix @@ -8,10 +8,19 @@ in lib.mkIf cfg.enable { hjem.users."${config.collinux.user.name}" = { - files.".config/fish/conf.d/fzf.fish".text = '' - ${pkgs.fzf}/bin/fzf --fish | source - set -gx FZF_DEFAULT_OPTS "--color bg:#1E1E2E,bg+:#313244,border:#313244,fg:#CDD6F4,fg+:#CDD6F4,header:#F38BA8,hl:#F38BA8,hl+:#F38BA8,info:#CBA6F7,label:#CDD6F4,marker:#B4BEFE,pointer:#F5E0DC,prompt:#CBA6F7,selected-bg:#45475A,spinner:#F5E0DC" - ''; + files = + (lib.optionalAttrs config.collinux.terminal.shells.fish.enable { + ".config/fish/conf.d/fzf.fish".text = '' + fzf --fish | source + set -gx FZF_DEFAULT_OPTS "--color bg:#1E1E2E,bg+:#313244,border:#313244,fg:#CDD6F4,fg+:#CDD6F4,header:#F38BA8,hl:#F38BA8,hl+:#F38BA8,info:#CBA6F7,label:#CDD6F4,marker:#B4BEFE,pointer:#F5E0DC,prompt:#CBA6F7,selected-bg:#45475A,spinner:#F5E0DC" + ''; + }) + // (lib.optionalAttrs config.collinux.terminal.shells.bash.enable { + ".config/bash/conf.d/fzf.bash".text = '' + eval "$(fzf --bash)" + export FZF_DEFAULT_OPTS="--color bg:#1E1E2E,bg+:#313244,border:#313244,fg:#CDD6F4,fg+:#CDD6F4,header:#F38BA8,hl:#F38BA8,hl+:#F38BA8,info:#CBA6F7,label:#CDD6F4,marker:#B4BEFE,pointer:#F5E0DC,prompt:#CBA6F7,selected-bg:#45475A,spinner:#F5E0DC" + ''; + }); packages = [pkgs.fzf]; }; diff --git a/modules/terminal/system/programs/helix.nix b/modules/terminal/system/programs/helix.nix index 71dad76..54a6932 100644 --- a/modules/terminal/system/programs/helix.nix +++ b/modules/terminal/system/programs/helix.nix @@ -156,15 +156,22 @@ in generator = (pkgs.formats.toml {}).generate "toml_file"; inherit value; }; - in { - ".config/helix/config.toml" = t settings; - ".config/helix/languages.toml" = t languages; - ".config/helix/themes/catppuccin_mocha_transparent.toml" = t theme; - - ".config/fish/conf.d/helix.fish".text = lib.mkIf config.collinux.terminal.shells.fish.enable '' - set -gx EDITOR hx - ''; - }; + in + { + ".config/helix/config.toml" = t settings; + ".config/helix/languages.toml" = t languages; + ".config/helix/themes/catppuccin_mocha_transparent.toml" = t theme; + } + // (lib.optionalAttrs config.collinux.terminal.shells.fish.enable { + ".config/fish/conf.d/helix.fish".text = '' + set -gx EDITOR hx + ''; + }) + // (lib.optionalAttrs config.collinux.terminal.shells.bash.enable { + ".config/bash/conf.d/helix.bash".text = '' + EDITOR=hx + ''; + }); packages = [pkgs.helix]; }; diff --git a/modules/terminal/system/programs/starship.nix b/modules/terminal/system/programs/starship.nix index c70a132..f0134f0 100644 --- a/modules/terminal/system/programs/starship.nix +++ b/modules/terminal/system/programs/starship.nix @@ -36,21 +36,28 @@ in lib.mkIf cfg.enable { hjem.users."${config.collinux.user.name}" = { - files = { - ".config/starship.toml" = { - generator = (pkgs.formats.toml {}).generate "starship.toml"; - value = settings; - }; + files = + { + ".config/starship.toml" = { + generator = (pkgs.formats.toml {}).generate "starship.toml"; + value = settings; + }; + } + // (lib.optionalAttrs config.collinux.terminal.shells.fish.enable { + ".config/fish/conf.d/starship.fish".text = '' + function starship_transient_prompt_func + starship module character + end - ".config/fish/conf.d/starship.fish".text = lib.mkIf config.collinux.terminal.shells.fish.enable '' - function starship_transient_prompt_func - starship module character - end - - starship init fish | source - enable_transience - ''; - }; + starship init fish | source + enable_transience + ''; + }) + // (lib.optionalAttrs config.collinux.terminal.shells.bash.enable { + ".config/bash/conf.d/starship.bash".text = '' + eval "$(starship init bash)" + ''; + }); packages = [pkgs.starship]; }; diff --git a/modules/terminal/system/programs/tmux.nix b/modules/terminal/system/programs/tmux.nix index 322a912..c349ded 100644 --- a/modules/terminal/system/programs/tmux.nix +++ b/modules/terminal/system/programs/tmux.nix @@ -242,7 +242,6 @@ tmux-conf = '' set -g mouse on - set -g default-terminal "tmux" # Panes bind-key -n C-w kill-pane |
