2024-11-19 10:31:29 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
2024-03-21 15:00:36 +01:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (lib) mkEnableOption mkIf;
|
|
|
|
|
|
|
|
cfg = config.metacfg.cli-apps.fish;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.metacfg.cli-apps.fish = {
|
|
|
|
enable = mkEnableOption "FISH shell";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
programs.fish = {
|
|
|
|
enable = true;
|
|
|
|
interactiveShellInit = ''
|
|
|
|
function msh --wraps mosh --description 'mosh with tmux'
|
|
|
|
if not set -q argv[1]
|
|
|
|
echo 'Usage: msh [user@]host [command]'
|
|
|
|
else
|
|
|
|
${pkgs.mosh}/bin/mosh $argv -- tmux new-session -A -s 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
function tsh --wraps ssh --description 'ssh with tmux'
|
|
|
|
if not set -q argv[1]
|
|
|
|
echo 'Usage: tsh [user@]host [command]'
|
|
|
|
else
|
|
|
|
${pkgs.openssh}/bin/ssh -t $argv -- tmux new-session -A -s 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|