nix-dotfiles/hmModules/apps/shells/fish/default.nix

35 lines
926 B
Nix
Raw Normal View History

2024-04-14 05:40:02 -07:00
{ config, pkgs, lib, ... }:
{
options.fish = {
enable = lib.mkEnableOption "Enables fish";
extraFunctions = lib.mkOption {
type = with lib.types; attrsOf lines;
default = {};
};
2024-04-14 05:40:02 -07:00
};
config = lib.mkIf config.fish.enable {
programs.fish = {
enable = true;
functions = {
fish_greeting = "";
fish_prompt = ''
if test $status -eq 0
echo -n -s (set_color blue -o) τ " " (set_color normal)
else
echo -n -s (set_color red -o) τ " " (set_color normal)
end
'';
fish_right_prompt = ''
git_prompt
echo -n -s (set_color blue) (prompt_pwd) " "
echo -n -s (set_color yellow) $CMD_DURATION ms
echo -n -s (set_color normal)
'';
git_prompt = ''${builtins.readFile ./functions/git_prompt.fish}'';
} // config.fish.extraFunctions;
2024-04-14 05:40:02 -07:00
};
};
}