2024-01-11 11:26:46 +01:00
|
|
|
{ lib
|
|
|
|
, config
|
|
|
|
, pkgs
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (lib) mkEnableOption mkIf;
|
|
|
|
|
2024-03-20 08:58:05 +01:00
|
|
|
cfg = config.metacfg.cli-apps.fish;
|
2024-01-11 11:26:46 +01:00
|
|
|
in
|
|
|
|
{
|
2024-03-20 08:58:05 +01:00
|
|
|
options.metacfg.cli-apps.fish = {
|
2024-01-11 11:26:46 +01:00
|
|
|
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
|
2024-03-06 12:25:53 +01:00
|
|
|
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
|
2024-01-11 11:26:46 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
plugins = [{
|
|
|
|
name = "foreign-env";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "oh-my-fish";
|
|
|
|
repo = "plugin-foreign-env";
|
|
|
|
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
|
|
|
|
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
|
|
|
|
};
|
|
|
|
}];
|
|
|
|
|
2024-03-05 00:02:22 +01:00
|
|
|
# shellInit =
|
|
|
|
# ''
|
|
|
|
# # nix
|
|
|
|
# if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
|
|
# fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# # home-manager
|
|
|
|
# if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
|
|
|
# fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
|
|
|
# end
|
|
|
|
# '';
|
2024-01-11 11:26:46 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|