nichts/modules/cli/fish.nix

64 lines
2.2 KiB
Nix
Raw Normal View History

2024-04-20 22:59:53 +02:00
{
config,
lib,
pkgs,
...
}: with lib; let
cfg = config.modules.programs.fish;
username = config.modules.other.system.username;
2024-04-29 23:26:46 +02:00
hostname = config.modules.other.system.hostname;
gitPath = 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";
default = {};
};
};
config = mkIf cfg.enable {
programs.fish.enable = true;
users.users.${username}.shell = pkgs.fish;
environment = {
shells = [ pkgs.fish ];
pathsToLink = [ "/share/fish" ];
};
home-manager.users.${username} = {
2024-04-29 23:26:46 +02:00
home.packages = with pkgs; [ nix-output-monitor ];
programs.zoxide.enable = true;
programs.zoxide.enableFishIntegration = true;
2024-04-20 22:59:53 +02:00
programs.fish = {
enable = true;
interactiveShellInit = "set fish_greeting";
plugins = [
2024-04-29 22:18:58 +02:00
{ name = "grc"; src = pkgs.fishPlugins.grc.src; }
{ name = "sponge"; src = pkgs.fishPlugins.sponge.src; }
{ name = "done"; src = pkgs.fishPlugins.done.src; }
{ name = "colored_man_pages"; src = pkgs.fishPlugins.colored-man-pages.src; }
{ name = "tide"; src = pkgs.fishPlugins.tide.src; }
2024-04-20 22:59:53 +02:00
];
2024-04-29 23:26:46 +02:00
shellAbbrs = {
c = "clear";
cc = "cd ~ && clear";
2024-04-20 22:59:53 +02:00
mv = "mv -iv";
rm = "trash -v";
2024-04-29 23:26:46 +02:00
ls = "eza";
2024-04-20 22:59:53 +02:00
l = "eza -a --icons";
2024-04-29 23:26:46 +02:00
la = "eza -lha --icons --git";
2024-04-20 22:59:53 +02:00
kys = "shutdown now";
2024-04-29 23:46:05 +02:00
lg = "lazygit";
2024-04-29 23:26:46 +02:00
cd = "z";
2024-04-29 23:46:05 +02:00
v = "nvim";
2024-04-30 00:04:08 +02:00
update = "sudo nixos-rebuild switch --flake \"${gitPath}#${hostname}\" --log-format internal-json &| nom --json";
2024-04-29 23:26:46 +02:00
flake = "cd '${gitPath}'";
2024-04-20 22:59:53 +02:00
} // cfg.extraAliases;
};
};
};
}