diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2016-11-03 23:28:33 +0100 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2016-11-03 23:28:33 +0100 |
| commit | ccedaf9aea9aa1aa1e0cebf0973da41cc61433db (patch) | |
| tree | af08adfbcb0c7ae481a3e46fd0f296720517e966 /modules | |
| parent | a31cda3b84fadc2fe47575814265d6def104a8f4 (diff) | |
add programs.tmux.loginShell option
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/tmux.nix | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/modules/tmux.nix b/modules/tmux.nix index 369e1c2..a983d19 100644 --- a/modules/tmux.nix +++ b/modules/tmux.nix @@ -14,6 +14,14 @@ let in { options = { + programs.tmux.loginShell = mkOption { + type = types.path; + default = "$SHELL"; + description = '' + Configure default login shell. + ''; + }; + programs.tmux.enableSensible = mkOption { type = types.bool; default = false; @@ -41,9 +49,16 @@ in { ''; }; + programs.tmux.config = mkOption { + type = types.lines; + description = '' + Configuration options. + ''; + }; + programs.tmux.text = mkOption { internal = true; - type = types.attrsOf types.str; + type = types.attrsOf types.lines; default = {}; }; @@ -51,8 +66,13 @@ in { config = { - system.build.setTmuxOptions = pkgs.writeText "set-tmux-options" - (lib.concatStringsSep "\n" tmuxConfigs); + programs.tmux.config = lib.concatStringsSep "\n" tmuxConfigs; + + programs.tmux.text.login-shell = if stdenv.isDarwin then '' + set -g default-command "reattach-to-user-namespace -l ${cfg.loginShell}" + '' else '' + set -g default-command "${cfg.loginShell}" + ''; programs.tmux.text.sensible = mkIf cfg.enableSensible ('' set -g default-terminal "screen-256color" |
