nixos-config/modules/home/apps/cli-apps/fish/default.nix

60 lines
1.3 KiB
Nix

{
config,
lib,
namespace,
options,
pkgs,
...
}:
with lib.${namespace};
let
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.apps.cli-apps.fish;
in
{
options.${namespace}.apps.cli-apps.fish = {
enable = mkBoolOpt true "Whether or not to enable the fish shell";
};
config = mkIf cfg.enable {
catppuccin.fish.enable = true;
programs = {
fish = {
enable = true;
shellInit = ''
zoxide init fish | source
direnv hook fish | source
set -x LESS_TERMCAP_mb \e'[01;32m'
set -x LESS_TERMCAP_md \e'[01;32m'
set -x LESS_TERMCAP_me \e'[0m'
set -x LESS_TERMCAP_se \e'[0m'
set -x LESS_TERMCAP_so \e'[01;47;34m'
set -x LESS_TERMCAP_ue \e'[0m'
set -x LESS_TERMCAP_us \e'[01;36m'
set -x LESS -R
set -x GROFF_NO_SGR 1
'';
shellAliases = {
vim = "hx";
ls = "eza -lah --icons --git";
lss = "ls --total-size";
};
plugins = with pkgs.fishPlugins; [
{
name = "forgit";
src = forgit.src;
}
];
};
zoxide = {
enable = true;
options = [ "--cmd cd" ];
};
};
};
}