nixos-config/home-manager/modules/fish/default.nix

94 lines
2.2 KiB
Nix

{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.eboskma.programs.fish;
in {
options.eboskma.programs.fish = {
enable = mkEnableOption "Enable fish shell";
};
config = mkIf (cfg.enable) {
programs.fish = {
enable = true;
functions = import ./functions.nix {inherit (pkgs) git;};
plugins = [
{
name = "dracula";
src = pkgs.fetchFromGitHub {
owner = "dracula";
repo = "fish";
rev = "28db361b55bb49dbfd7a679ebec9140be8c2d593";
sha256 = "07kz44ln75n4r04wyks1838nhmhr7jqmsc1rh7am7glq9ja9inmx";
};
}
];
shellAliases = {
# code = "${pkgs.vscode}/bin/code --enable-features=UseOzonePlatform --ozone-platform=wayland";
ls = "${pkgs.exa}/bin/exa -Fb";
vimdiff = mkIf (config.eboskma.programs.neovim.enable) "nvim -d";
vim = mkIf (config.eboskma.programs.neovim.enable) "nvim";
vi = mkIf (config.eboskma.programs.neovim.enable) "nvim";
};
interactiveShellInit = ''
'';
};
programs.starship = {
enable = true;
enableFishIntegration = true;
settings = {
aws.disabled = true;
directory.read_only = " ";
docker_context.symbol = " ";
elixir.symbol = " ";
git_branch.symbol = " ";
nix_shell.symbol = " ";
memory_usage.symbol = " ";
package.symbol = " ";
python.symbol = " ";
rust.symbol = " ";
time.disabled = false;
status = {
disabled = false;
format = "[$symbol $status]($style) ";
};
};
};
programs.fzf = {
enable = true;
enableFishIntegration = true;
changeDirWidgetCommand = "${pkgs.fd}/bin/fd -type d";
defaultCommand = "${pkgs.fd}/bin/fd -type f";
defaultOptions = [
"--cycle"
"--layout=reverse"
"--border"
"--height=90%"
"--preview-window=wrap"
"--marker='*'"
];
fileWidgetCommand = "${pkgs.fd}/bin/fd -type f";
};
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
programs.zoxide = {
enable = true;
enableFishIntegration = true;
};
};
}