28 lines
618 B
Nix
28 lines
618 B
Nix
{
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib) mkEnableOption mkIf;
|
|
|
|
cfg = config.metacfg.cli-apps.bash;
|
|
in
|
|
{
|
|
options.metacfg.cli-apps.bash = {
|
|
enable = mkEnableOption "BASH shell";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = with pkgs; [ bashInteractive ];
|
|
programs.bash = {
|
|
enable = true;
|
|
initExtra = ''
|
|
function msh() { mosh "$@" -- bash -c 'if type -f tmux; then tmux new-session -A -s 0; else screen -R; fi;' ; };
|
|
function tsh() { ssh -t "$@" -- bash -c 'if type -f tmux; then tmux new-session -A -s 0; else screen -R; fi;' ; };
|
|
'';
|
|
};
|
|
};
|
|
}
|