From a23aa285d9d1e96792e2340bb6636c991aac4d86 Mon Sep 17 00:00:00 2001 From: Sean Kovacs Date: Tue, 6 Jan 2026 12:50:26 -0500 Subject: [PATCH] update fish prompt --- home/terminal/fish/default.nix | 12 +++++++++ home/terminal/fish/functions/fish-prompt.fish | 26 +++++++++++-------- home/terminal/nvim/default.nix | 1 + 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/home/terminal/fish/default.nix b/home/terminal/fish/default.nix index a5b233b..c19b948 100644 --- a/home/terminal/fish/default.nix +++ b/home/terminal/fish/default.nix @@ -1,6 +1,7 @@ { config, pkgs, + lib, ... }: { home.packages = with pkgs; [kdePackages.qttools]; @@ -29,4 +30,15 @@ }; }; }; + + home.file.".config/fish/colors.fish" = { + text = let + flavor = config.catppuccin.flavor; + palette = pkgs.catppuccin.bare.${flavor}; + in + lib.concatStringsSep "\n" ( + lib.mapAttrsToList (name: value: "set -g color_${name} ${value}") palette + ); + force = true; + }; } diff --git a/home/terminal/fish/functions/fish-prompt.fish b/home/terminal/fish/functions/fish-prompt.fish index f38e382..09d3ae9 100644 --- a/home/terminal/fish/functions/fish-prompt.fish +++ b/home/terminal/fish/functions/fish-prompt.fish @@ -1,24 +1,28 @@ +source ~/.config/fish/colors.fish set -l last_status $status set -l nix_shell_info ( if test -n "$IN_NIX_SHELL" echo -n " " end ) -set -g fish_color_user 89dceb +set -g color_user $color_sky +set -g color_host $color_red +set -g color_cwd $color_green # Set host color based on hostname -if test (hostname) = "peach" - set -g fish_color_host fab387 -else if test (hostname) = "alien" - set -g fish_color_host 89b4fa -else if test (hostname) = "vm-aarch64" - set -g fish_color_host a6e3a1 -else if test (uname) = "Darwin" - set -g fish_color_host f9e2af +if test (hostname) = peach + set -g color_host $color_peach +else if test (hostname) = alien + set -g color_host $color_blue +else if test (hostname) = vm-aarch64 + set -g color_host $color_green + set -g color_cwd $color_red +else if test (uname) = Darwin + set -g color_host $color_yellow end -set -l user_host (set_color $fish_color_user)"$USER"(set_color normal)"@"(set_color $fish_color_host)(prompt_hostname)(set_color normal) -set -l cwd (set_color $fish_color_cwd)(prompt_pwd)(set_color normal) +set -l user_host (set_color $color_user)"$USER"(set_color normal)"@"(set_color $color_host)(prompt_hostname)(set_color normal) +set -l cwd (set_color $color_cwd)(prompt_pwd)(set_color normal) set -l git_info (fish_git_prompt) echo -s "$user_host" " " "$cwd" "$git_info $nix_shell_info" echo -n -s "> " diff --git a/home/terminal/nvim/default.nix b/home/terminal/nvim/default.nix index 68649a4..1843db3 100644 --- a/home/terminal/nvim/default.nix +++ b/home/terminal/nvim/default.nix @@ -159,6 +159,7 @@ css = ["prettier"]; json = ["prettier"]; jsonc = ["prettier"]; + fish = ["fish_indent"]; }; # Default formatting options