dotfiles/homes/modules/fish.nix
Emile Clark-Boman 87c92d308b make fish source a random banner
do butterflies cry when they're sad?
2025-07-26 18:20:46 +10:00

37 lines
834 B
Nix
Executable file

{
config,
lib,
pkgs,
...
}: {
options = {
morphBashToFish = lib.mkEnableOption "morphBashToFish";
};
config = {
programs.fish = {
enable = true;
interactiveShellInit = ''
# add dotnet completions if it exists (ie we're in a virtual environment)
if type -q dotnet
complete -f -c dotnet -a "(dotnet complete (commandline -cp))"
end
function rand_greet
set weary "Welcome weary traveller to my shop"
set sad "Do butterflies cry when they're sad?"
set greetings "$weary" "$sad"
echo -n $greetings[(random 1 (count $greetings))]
end
set -g fish_greeting (rand_greet)
'';
plugins = [
{
name = "grc";
src = pkgs.fishPlugins.grc.src;
}
];
};
};
}