update fish

This commit is contained in:
Sean Kovacs 2025-11-22 13:16:23 -05:00
commit a56d72e589
Signed by: sckova
GPG key ID: 00F325187C68651A
2 changed files with 42 additions and 1 deletions

View file

@ -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 "<nix-shell> "
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
'';
};
};
};
}

View file

@ -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