nix-managed-macbook/programs/fish.nix

49 lines
1.3 KiB
Nix
Raw Normal View History

2024-01-31 16:00:03 +05:30
{ inputs, config, osConfig, pkgs, ... }:
2022-09-27 13:08:52 +05:30
2023-11-25 16:13:20 +05:30
let username = config.home.username;
in {
2022-09-27 13:08:52 +05:30
programs.fish = {
enable = true;
plugins = [
{
name = "foreign-env";
src = inputs.fish-plugin-foreign-env;
2022-09-27 13:08:52 +05:30
}
{
name = "fzf";
src = inputs.fish-plugin-fzf;
2022-09-27 13:08:52 +05:30
}
];
2022-09-27 17:58:53 +05:30
functions = {
where = "readlink -f (which $argv)";
ghe =
"set -l dir (mktemp -d); git clone --depth 1 https://github.com/$argv $dir; cd $dir; ranger;";
};
2022-09-27 13:08:52 +05:30
interactiveShellInit = ''
fzf_configure_bindings --git_status=\cs --history=\cr --variables=\cv --directory=\cf --git_log=\cg
2024-01-31 16:00:03 +05:30
if test -d (brew --prefix)"/share/fish/completions"
set -p fish_complete_path (brew --prefix)/share/fish/completions
end
if test -d (brew --prefix)"/share/fish/vendor_completions.d"
set -p fish_complete_path (brew --prefix)/share/fish/vendor_completions.d
end
2024-04-01 23:33:42 +05:30
neofetch
2022-09-27 13:08:52 +05:30
'';
shellInit = ''
# nix
2022-09-30 15:34:01 +05:30
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
2024-04-01 23:33:42 +05:30
fenv source /run/current-system/etc/bashrc
2023-11-25 16:13:20 +05:30
fenv source /etc/profiles/per-user/${username}/etc/profile.d/hm-session-vars.sh
fish_add_path -m ~/.local/bin ~/.cabal/bin /etc/profiles/per-user/${username}/bin
2024-01-31 16:00:03 +05:30
eval "$(${osConfig.homebrew.brewPrefix}/brew shellenv)"
2022-09-27 13:08:52 +05:30
'';
};
}