config/modules/home/shells/fish/default.nix

154 lines
2.9 KiB
Nix
Raw Normal View History

2024-12-19 21:47:51 -05:00
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.shells.fish;
in {
options.shells.fish = with types; {
enable = mkBoolOpt false "Enable Fish Configuration";
};
config = mkIf cfg.enable {
programs.fish = {
enable = true;
2025-05-28 12:33:51 -04:00
generateCompletions = false;
2024-12-19 21:47:51 -05:00
interactiveShellInit = ''
set -gx LC_ALL en_US.UTF-8
set -gx SSH_AUTH_SOCK /run/user/1000/keyring/ssh
2025-05-23 11:58:24 -04:00
set -gx NH_FLAKE /home/zoey/nixos/
2024-12-19 21:47:51 -05:00
set -g FZF_PREVIEW_FILE_CMD "head -n 10"
set -g FZF_PREVIEW_DIR_CMD "ls"
2025-05-23 11:58:24 -04:00
if not set -q TMUX
tmux
end
2024-12-19 21:47:51 -05:00
'';
plugins = [
{
name = "foreign-env";
src = pkgs.fishPlugins.foreign-env.src;
}
{
name = "fzf.fish";
src = pkgs.fishPlugins.fzf-fish.src;
}
{
name = "z";
src = pkgs.fishPlugins.z.src;
}
{
name = "done";
src = pkgs.fishPlugins.done.src;
}
{
name = "colored-man-pages";
src = pkgs.fishPlugins.colored-man-pages.src;
}
];
functions = {
pf = ''
fzf --bind ctrl-y:preview-up,ctrl-e:preview-down \
--bind ctrl-b:preview-page-up,ctrl-f:preview-page-down \
--bind ctrl-u:preview-half-page-up,ctrl-d:preview-half-page-down \
--bind ctrl-k:up,ctrl-j:down \
--preview='bat --style=numbers --color=always --line-range :100 {}'
'';
ff = ''
for file in (pf)
set cmd "v $file"
echo $cmd
eval $cmd
end
'';
};
2025-05-19 18:28:46 -04:00
shellAliases = import ../aliases.nix {inherit pkgs lib config;};
2024-12-19 21:47:51 -05:00
};
2025-05-28 19:10:50 -04:00
home.packages = with pkgs;
[
gnumake
# Runs programs without installing them
comma
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# grep replacement
ripgrep
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# ping, but with cool graph
gping
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
fzf
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# dns client
dogdns
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# neofetch but for git repos
onefetch
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# neofetch but for cpu's
cpufetch
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# download from yt and other websites
yt-dlp
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
zsh-history
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# man pages for tiktok attention span mfs
tealdeer
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# markdown previewer
glow
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# profiling tool
hyperfine
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
imagemagick
ffmpeg-full
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# preview images in terminal
catimg
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# networking stuff
nmap
wget
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# faster find
fd
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# http request thingy
xh
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# generate regex
grex
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# json thingy
jq
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
# syncthnig for acoustic people
rsync
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
figlet
# Generate qr codes
qrencode
2024-12-19 21:47:51 -05:00
2025-05-28 19:10:50 -04:00
unzip
]
++ (
if !pkgs.stdenv.isDarwin
then [
hcxdumptool
hashcat
]
else []
);
2024-12-19 21:47:51 -05:00
};
}