Compare commits

...

5 commits

Author SHA1 Message Date
Bruno BELANYI 607d11bbad home: zsh: disable tmux auto-launch by default
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-22 16:12:30 +00:00
Bruno BELANYI 06989facc2 machines: porthos: home: enable tmux auto-launch
I'm about to flip the default to always disabled, so enable it
explicitly.
2023-02-22 16:12:07 +00:00
Bruno BELANYI 55b828cba9 machines: porthos: add home configuration 2023-02-22 16:12:07 +00:00
Bruno BELANYI 34c13b077f home: zsh: refactor tmux auto-launch configuration
Introduce an actual option for this behaviour.
2023-02-22 16:11:18 +00:00
Bruno BELANYI 0bbf522c03 home: tmux: change 'use lib.my' to 'use libs' 2023-02-22 16:00:26 +00:00
3 changed files with 22 additions and 10 deletions

View file

@ -3,8 +3,10 @@ let
cfg = config.my.home.zsh;
in
{
options.my.home.zsh = with lib.my; {
enable = mkDisableOption "zsh configuration";
options.my.home.zsh = with lib; {
enable = my.mkDisableOption "zsh configuration";
launchTmux = mkEnableOption "auto launch tmux at shell start";
};
config = lib.mkIf cfg.enable {
@ -44,14 +46,16 @@ in
defaultKeymap = "emacs";
# Make those happen early to avoid doing double the work
initExtraFirst =
lib.optionalString config.my.home.tmux.enable ''
# Launch tmux unless already inside one
if [ -z "$TMUX" ]; then
exec tmux new-session
fi
''
;
initExtraFirst = ''
${
lib.optionalString cfg.launchTmux ''
# Launch tmux unless already inside one
if [ -z "$TMUX" ]; then
exec tmux new-session
fi
''
}
'';
initExtra = ''
source ${./completion-styles.zsh}

View file

@ -5,6 +5,7 @@
imports = [
./boot.nix
./hardware.nix
./home.nix
./networking.nix
./services.nix
./users.nix

View file

@ -0,0 +1,7 @@
{ ... }:
{
my.home = {
# Always start a tmux session when opening a shell session
zsh.launchTmux = true;
};
}