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

85 lines
2.1 KiB
Nix
Raw Normal View History

2024-02-05 11:46:52 +01:00
{
pkgs,
config,
lib,
...
2022-03-01 22:19:03 +01:00
}:
2024-02-05 11:46:52 +01:00
with lib;
let
2022-03-01 22:19:03 +01:00
cfg = config.eboskma.programs.fish;
2024-04-12 08:45:05 +02:00
catppuccin = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "fish";
rev = "0ce27b518e8ead555dec34dd8be3df5bd75cff8e";
hash = "sha256-Dc/zdxfzAUM5NX8PxzfljRbYvO9f9syuLO8yBr+R3qg=";
};
in
{
2021-11-17 16:32:18 +01:00
options.eboskma.programs.fish = {
enable = mkEnableOption "Enable fish shell";
};
2022-05-03 18:17:38 +02:00
config = mkIf cfg.enable {
2023-09-13 14:50:03 +02:00
programs = {
fish = {
enable = true;
functions = import ./functions.nix { inherit pkgs; };
2021-11-17 16:32:18 +01:00
2023-09-13 14:50:03 +02:00
plugins = [
{
name = "dracula";
src = pkgs.fetchFromGitHub {
owner = "dracula";
repo = "fish";
2024-02-07 08:37:25 +01:00
rev = "269cd7d76d5104fdc2721db7b8848f6224bdf554";
sha256 = "Hyq4EfSmWmxwCYhp3O8agr7VWFAflcUe8BUKh50fNfY=";
2023-09-13 14:50:03 +02:00
};
}
];
2021-12-18 16:23:14 +01:00
2023-09-13 14:50:03 +02:00
shellAliases = {
2024-04-12 08:47:33 +02:00
ls = "${pkgs.eza}/bin/eza --long --git --git-repos --header --classify --binary";
2024-04-16 19:32:50 +02:00
tree = "${pkgs.eza}/bin/eza --tree --icons";
2022-01-13 09:03:22 +01:00
2023-09-13 14:50:03 +02:00
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";
};
2024-04-15 16:29:21 +02:00
interactiveShellInit = ''
set -Ux CARAPACE_BRIDGES 'zsh,fish,bash,inshellisense'
${pkgs.carapace}/bin/carapace _carapace | source
'';
2023-09-13 14:50:03 +02:00
};
2021-11-17 16:32:18 +01:00
2023-09-13 14:50:03 +02:00
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";
};
2021-11-17 16:32:18 +01:00
2023-09-13 14:50:03 +02:00
direnv = {
enable = true;
nix-direnv.enable = true;
};
2021-11-25 17:18:13 +01:00
2023-09-13 14:50:03 +02:00
zoxide = {
enable = true;
enableFishIntegration = true;
};
2021-11-25 17:18:13 +01:00
};
2024-04-12 08:45:05 +02:00
xdg.configFile."fish/themes/Catppuccin Mocha.theme".source = "${catppuccin}/themes/Catppuccin Mocha.theme";
2021-11-17 16:32:18 +01:00
};
}