Files
dotfiles/nix/modules/fish/default.nix

71 lines
1.9 KiB
Nix

{ config, lib, pkgs, ... }:
let tide_conf = builtins.readFile ./tide_config.fish; in
{
programs.zoxide = {
enable = true;
enableFishIntegration = true;
options = ["--cmd j"];
};
programs.fzf = {
enable = true;
enableFishIntegration = false;
};
programs.fish = {
enable = true;
plugins = [
{
# https://github.com/IlanCosman/tide
name = "tide";
src = pkgs.fetchFromGitHub {
owner = "IlanCosman";
repo = "tide";
rev = "13fa55ef109009e04e6e5fabda0d0e662b4e6315";
sha256 = "sha256-+6LdcFLqDzUcCmBoKO4LDH5+5odqVqUb1NmEVNMEMjs=";
};
}
{
# https://github.com/PatrickF1/fzf.fish
name = "fzf";
src = pkgs.fishPlugins.fzf-fish.src;
}
];
shellInit = ''
set --universal fish_greeting
set -g -x EDITOR "emacsclient"
set -g -x ALTERNATE_EDITOR "vim"
set -g -x TERMINAL "kitty"
set -g -x MANPAGER less -x
set -g -x LESS "--ignore-case --QUIET --RAW-CONTROL-CHARS"
fish_add_path --path ~/.dotfiles/bin ~/.local/bin ~/bin
# TODO - Adjust for nix-managed Doom if I ever do that
fish_add_path ~/.emacs.d/bin
fzf_configure_bindings --history=\cr --directory=\ef --git_status=\es
${builtins.readFile ./tide_config.fish}
'';
shellAliases = {
ec = "emacsclient -n --alternate-editor=emacs";
pubip = "curl icanhazip.com";
src = "source ~/.config/fish/config.fish && clear";
redesktop = "kquitapp5 plasmashell && kstart5 plasmashell";
pulsefix = "pulseaudio --kill; pulseaudio --start";
};
};
# TODO -- port from Xonsh config
# if $TERM == "xterm-kitty":
# # Wrap ssh with environment variable because servers tend to deal poorly with kitty
# def xterm_ssh(args):
# $TERM="xterm-256color" ssh @(args)
#
# aliases["ssh"] = xterm_ssh
}