2024-05-15 00:14:59 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.modules.programs.fish;
|
|
|
|
username = config.modules.other.system.username;
|
2024-05-15 13:59:52 +02:00
|
|
|
# not needed because I'm using nh os switch
|
|
|
|
# hostname = config.modules.other.system.hostname;
|
2024-05-15 00:14:59 +02:00
|
|
|
gitPath = config.modules.other.system.gitPath;
|
2024-04-20 22:59:53 +02:00
|
|
|
in {
|
2024-05-15 00:14:59 +02:00
|
|
|
options.modules.programs.fish = {
|
|
|
|
enable = mkEnableOption "fish";
|
|
|
|
extraAliases = mkOption {
|
|
|
|
type = types.attrs;
|
|
|
|
description = "extra shell aliases";
|
|
|
|
default = { };
|
2024-04-20 22:59:53 +02:00
|
|
|
};
|
2024-05-15 00:14:59 +02:00
|
|
|
};
|
2024-04-20 22:59:53 +02:00
|
|
|
|
2024-05-15 00:14:59 +02:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
programs.fish.enable = true;
|
2024-04-20 22:59:53 +02:00
|
|
|
|
2024-05-15 00:14:59 +02:00
|
|
|
users.users.${username}.shell = pkgs.fish;
|
2024-04-20 22:59:53 +02:00
|
|
|
|
2024-05-15 00:14:59 +02:00
|
|
|
environment = {
|
|
|
|
shells = [ pkgs.fish ];
|
|
|
|
pathsToLink = [ "/share/fish" ];
|
|
|
|
};
|
2024-04-20 22:59:53 +02:00
|
|
|
|
2024-05-15 00:14:59 +02:00
|
|
|
home-manager.users.${username} = {
|
|
|
|
home.packages = with pkgs; [ nix-output-monitor ];
|
|
|
|
programs.zoxide.enable = true;
|
|
|
|
programs.zoxide.enableFishIntegration = true;
|
|
|
|
programs.fish = {
|
|
|
|
enable = true;
|
|
|
|
interactiveShellInit = "set fish_greeting";
|
|
|
|
plugins = [
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
shellAbbrs = {
|
|
|
|
c = "clear";
|
|
|
|
cc = "cd ~ && clear";
|
|
|
|
mv = "mv -iv";
|
|
|
|
rm = "trash -v";
|
2024-05-15 13:59:52 +02:00
|
|
|
ls = "eza --icons";
|
2024-05-15 00:14:59 +02:00
|
|
|
l = "eza -a --icons";
|
|
|
|
la = "eza -lha --icons --git";
|
|
|
|
kys = "shutdown now";
|
|
|
|
lg = "lazygit";
|
|
|
|
cd = "z";
|
|
|
|
v = "nvim";
|
|
|
|
h = "hx";
|
|
|
|
e = "emacs";
|
2024-05-15 13:59:52 +02:00
|
|
|
update = ''nh os switch "${gitPath}"'';
|
2024-05-15 00:14:59 +02:00
|
|
|
flake = "cd '${gitPath}'";
|
|
|
|
} // cfg.extraAliases;
|
|
|
|
};
|
2024-04-20 22:59:53 +02:00
|
|
|
};
|
2024-05-15 00:14:59 +02:00
|
|
|
};
|
2024-04-20 22:59:53 +02:00
|
|
|
}
|