update fish
This commit is contained in:
parent
f2610a0432
commit
4f15e4623c
2 changed files with 42 additions and 1 deletions
40
home/terminal/fish/default.nix
Normal file
40
home/terminal/fish/default.nix
Normal 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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -29,8 +29,9 @@
|
||||||
../home/browsers/firefox/default.nix
|
../home/browsers/firefox/default.nix
|
||||||
../home/systemd/default.nix
|
../home/systemd/default.nix
|
||||||
../home/terminal/btop/default.nix
|
../home/terminal/btop/default.nix
|
||||||
../home/terminal/nvim/default.nix
|
../home/terminal/fish/default.nix
|
||||||
../home/terminal/kitty/default.nix
|
../home/terminal/kitty/default.nix
|
||||||
|
../home/terminal/nvim/default.nix
|
||||||
../home/kde/plasma.nix
|
../home/kde/plasma.nix
|
||||||
../home/kde/other.nix
|
../home/kde/other.nix
|
||||||
../home/vscode/default.nix
|
../home/vscode/default.nix
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue