From a56d72e589c340e91786113387da17cd0a6b855c Mon Sep 17 00:00:00 2001 From: Sean Kovacs Date: Sat, 22 Nov 2025 13:16:23 -0500 Subject: [PATCH] update fish --- home/terminal/fish/default.nix | 40 ++++++++++++++++++++++++++++++++++ system/all.nix | 3 ++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 home/terminal/fish/default.nix diff --git a/home/terminal/fish/default.nix b/home/terminal/fish/default.nix new file mode 100644 index 0000000..b5a93b5 --- /dev/null +++ b/home/terminal/fish/default.nix @@ -0,0 +1,40 @@ +{ config, pkgs, ... }: + +{ + programs.fish = { + enable = true; + + functions = { + fish_prompt = { + description = "Write out the prompt"; + body = '' + set -l last_status $status + + set -l nix_shell_info ( + if test -n "$IN_NIX_SHELL" + echo -n " " + 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 git_info (fish_git_prompt) + + echo -n -s "$user_host" " " "$nix_shell_info" "$cwd" "$git_info" "> " + ''; + }; + nix-shell = { + description = "Wrapper for nix-shell that runs fish by default"; + body = '' + if test (count $argv) -eq 0 + command nix-shell --run fish + else + command nix-shell --run fish $argv + end + ''; + }; + }; + }; +} diff --git a/system/all.nix b/system/all.nix index 49ed377..3e4ff53 100755 --- a/system/all.nix +++ b/system/all.nix @@ -29,8 +29,9 @@ ../home/browsers/firefox/default.nix ../home/systemd/default.nix ../home/terminal/btop/default.nix - ../home/terminal/nvim/default.nix + ../home/terminal/fish/default.nix ../home/terminal/kitty/default.nix + ../home/terminal/nvim/default.nix ../home/kde/plasma.nix ../home/kde/other.nix ../home/vscode/default.nix