nichts/modules/cli/fish.nix

78 lines
1.8 KiB
Nix
Raw Normal View History

2024-05-22 14:29:45 +02:00
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.programs.fish;
inherit (config.modules.other.system) username;
inherit (config.modules.other.system) gitPath;
2024-04-20 22:59:53 +02:00
in {
options.modules.programs.fish = {
enable = mkEnableOption "fish";
extraAliases = mkOption {
type = types.attrs;
description = "extra shell aliases";
2024-05-22 14:29:45 +02:00
default = {};
2024-04-20 22:59:53 +02:00
};
};
2024-04-20 22:59:53 +02:00
config = mkIf cfg.enable {
programs.fish.enable = true;
2024-04-20 22:59:53 +02:00
users.users.${username}.shell = pkgs.fish;
2024-04-20 22:59:53 +02:00
environment = {
2024-05-22 14:29:45 +02:00
shells = [pkgs.fish];
pathsToLink = ["/share/fish"];
};
2024-04-20 22:59:53 +02:00
home-manager.users.${username} = {
2024-05-22 14:29:45 +02:00
home.packages = with pkgs; [nix-output-monitor];
programs = {
zoxide.enable = true;
zoxide.enableFishIntegration = true;
fish = {
enable = true;
interactiveShellInit = "set fish_greeting";
plugins = [
{
name = "sponge";
inherit (pkgs.fishPlugins.sponge) src;
}
{
name = "done";
inherit (pkgs.fishPlugins.done) src;
}
{
name = "tide";
inherit (pkgs.fishPlugins.tide) src;
}
];
shellAbbrs =
{
c = "clear";
cc = "cd ~ && clear";
mv = "mv -iv";
rm = "trash -v";
ls = "eza --icons";
l = "eza -a --icons";
la = "eza -lha --icons --git";
kys = "shutdown now";
lg = "lazygit";
cd = "z";
v = "nvim";
h = "hx";
k = "kak";
e = "emacs";
update = ''nh os switch "${gitPath}"'';
flake = "cd '${gitPath}'";
}
// cfg.extraAliases;
};
};
2024-04-20 22:59:53 +02:00
};
};
2024-04-20 22:59:53 +02:00
}