53 lines
1.7 KiB
Nix
53 lines
1.7 KiB
Nix
|
{ config, lib, pkgs, ... }:
|
||
|
with lib;
|
||
|
let cfg = config.features.cli.fish;
|
||
|
in {
|
||
|
options.features.cli.fish.enable = mkEnableOption "enable fish shell";
|
||
|
|
||
|
config = mkIf cfg.enable {
|
||
|
programs.fish = {
|
||
|
enable = true;
|
||
|
plugins = [{
|
||
|
name = "foreign-env";
|
||
|
src = pkgs.fetchFromGitHub {
|
||
|
owner = "oh-my-fish";
|
||
|
repo = "plugin-foreign-env";
|
||
|
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
|
||
|
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
|
||
|
};
|
||
|
}];
|
||
|
loginShellInit = ''
|
||
|
set -x TERMINAL alacritty
|
||
|
set -x XDG_DATA_HOME $HOME/.local/share
|
||
|
set -x FZF_CTRL_R_OPTS "
|
||
|
--preview='bat --color=always -n {}'
|
||
|
--preview-window up:3:hidden:wrap
|
||
|
--bind 'ctrl-/:toggle-preview'
|
||
|
--color header:bold
|
||
|
--header 'Press CTRL-Y to copy command into clipboard'"
|
||
|
set -x FZF_ALT_C_COMMAND fd --type d --exclude .git --follow --hidden
|
||
|
set -x FZF_DEFAULT_COMMAND fd --type f --exclude .git --follow --hidden
|
||
|
set -x FZF_CTRL_T_COMMAND "$FZF_DEFAULT_COMMAND"
|
||
|
set -x FZF_DEFAULT_OPTS "
|
||
|
--preview='bat --color=always -n {}'
|
||
|
--bind 'ctrl-/:toggle-preview'
|
||
|
--color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9
|
||
|
--color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9
|
||
|
--color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6
|
||
|
--color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4"
|
||
|
'';
|
||
|
shellAbbrs = {
|
||
|
".." = "cd ..";
|
||
|
ls = "eza";
|
||
|
grep = "rg";
|
||
|
ps = "procs";
|
||
|
just = "just --unstable";
|
||
|
fs = "du -ah . | sort -hr | head -n 10";
|
||
|
|
||
|
tsu = "sudo tailscale up";
|
||
|
tsd = "sudo tailscale down";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|