diff --git a/home/zsh/default.nix b/home/zsh/default.nix index bd5906d..84eb7a3 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -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} diff --git a/machines/porthos/default.nix b/machines/porthos/default.nix index abfc01a..6d7df29 100644 --- a/machines/porthos/default.nix +++ b/machines/porthos/default.nix @@ -5,6 +5,7 @@ imports = [ ./boot.nix ./hardware.nix + ./home.nix ./networking.nix ./services.nix ./users.nix diff --git a/machines/porthos/home.nix b/machines/porthos/home.nix new file mode 100644 index 0000000..53d5d25 --- /dev/null +++ b/machines/porthos/home.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + my.home = { + # Always start a tmux session when opening a shell session + zsh.launchTmux = true; + }; +}