2025-05-03 20:40:22 +08:00
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
lib,
|
2025-09-17 00:25:17 +08:00
|
|
|
pkgs,
|
2025-05-03 20:40:22 +08:00
|
|
|
...
|
2025-07-13 06:04:55 +08:00
|
|
|
}:
|
|
|
|
|
let
|
2025-05-03 20:40:22 +08:00
|
|
|
cfg = config.youthlic.programs.fish;
|
2025-07-13 06:04:55 +08:00
|
|
|
in
|
|
|
|
|
{
|
2025-05-03 20:40:22 +08:00
|
|
|
options = {
|
|
|
|
|
youthlic.programs.fish = {
|
|
|
|
|
enable = lib.mkEnableOption "fish";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
|
programs = {
|
|
|
|
|
fish = {
|
|
|
|
|
enable = true;
|
2025-07-13 06:04:55 +08:00
|
|
|
preferAbbrs = true;
|
2025-05-03 20:40:22 +08:00
|
|
|
interactiveShellInit = ''
|
|
|
|
|
fish_vi_key_bindings
|
|
|
|
|
'';
|
2025-09-17 00:25:17 +08:00
|
|
|
plugins = [
|
|
|
|
|
{
|
|
|
|
|
name = with pkgs.fishPlugins.foreign-env; pname + "-" + version;
|
|
|
|
|
src = pkgs.fishPlugins.foreign-env.overrideAttrs {
|
|
|
|
|
postInstall = # bash
|
|
|
|
|
''
|
|
|
|
|
ln -s $out/share/fish/vendor_functions.d $out/functions
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
];
|
2025-05-03 20:40:22 +08:00
|
|
|
functions = {
|
|
|
|
|
__fish_command_not_found_handler = {
|
|
|
|
|
body = "__fish_default_command_not_found_handler $argv[1]";
|
|
|
|
|
onEvent = "fish_command_not_found";
|
|
|
|
|
};
|
|
|
|
|
fish_greeting = {
|
|
|
|
|
body = ''
|
|
|
|
|
fastfetch
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
2025-09-17 00:25:17 +08:00
|
|
|
shellInitLast = # fish
|
|
|
|
|
''
|
|
|
|
|
if test -d ~/.guix-profile
|
|
|
|
|
set -gx GUIX_PROFILE ~/.guix-profile
|
|
|
|
|
if test -f $GUIX_PROFILE/etc/profile
|
|
|
|
|
fenv source $GUIX_PROFILE/etc/profile
|
|
|
|
|
end
|
|
|
|
|
if test -d $GUIX_PROFILE/lib/locale
|
|
|
|
|
set -gx GUIX_LOCPATH $GUIX_PROFILE/lib/locale
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
'';
|
2025-05-03 20:40:22 +08:00
|
|
|
};
|
|
|
|
|
fastfetch.enable = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|