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

76 lines
1.8 KiB
Nix
Raw Normal View History

2021-11-17 16:32:18 +01:00
{ 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;
2021-11-21 19:07:12 +01:00
functions = {
reload = {
body = ''
history --save
set -gx dirprev $dirprev
set -gx dirnext $dirnext
set -gx dirstack $dirstack
set -g fish_greeting ""
exec fish
'';
description = "Reload Fish while keeping some context";
};
};
2021-11-17 16:32:18 +01:00
2021-11-21 19:07:12 +01:00
shellAliases = {
code = "${pkgs.vscode}/bin/code --enable-features=UseOzonePlatform --ozone-platform=wayland";
ls = "${pkgs.exa}/bin/exa -Fb";
};
2021-11-17 16:32:18 +01:00
# interactiveShellInit = ''
# '';
};
programs.starship = {
enable = true;
enableFishIntegration = true;
2021-11-21 19:07:12 +01:00
settings = {
aws.disabled = true;
git_branch.symbol = " ";
memory_usage.symbol = " ";
package.symbol = " ";
python.symbol = " ";
rust.symbol = " ";
time.disabled = false;
status = {
disabled = false;
format = "[$symbol $status]($style) ";
};
};
2021-11-17 16:32:18 +01:00
};
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;
};
};
}