nix-managed-macbook/programs/fish.nix

54 lines
1.5 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
2024-09-14 11:07:38 +05:30
let
username = config.home.username;
fishPlugins = with pkgs.fishPlugins; [
autopair-fish
colored-man-pages
foreign-env
fzf-fish
gruvbox
];
2023-11-25 16:13:20 +05:30
in {
2022-09-27 13:08:52 +05:30
programs.fish = {
enable = true;
2024-09-14 11:07:38 +05:30
plugins = builtins.map (p: {
name = p.meta.name;
src = p.src;
}) fishPlugins;
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;";
2024-10-05 11:22:08 +05:30
nix-roots = "nix-store --gc --print-roots | grep -v lsof | grep -v flake-inputs | grep -v libproc | grep -v temp";
2022-09-27 17:58:53 +05:30
};
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
2024-05-02 19:05:26 +05:30
fastfetch
2024-09-07 10:46:54 +05:30
set -gx EDITOR micro
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
'';
};
}