feat(tmux): add a native Module and enable it on neogaia

Configure tmux through home-manager's programs.tmux: the settings it exposes
as options (prefix, keyMode, mouse, baseIndex, clock24, escapeTime,
historyLimit, terminal) are set as options, and every setting it has no option
for is read verbatim from modules/tmux/extra.conf. No tmux plugin manager is
used. The generated config is behaviourally identical to the reference, verified
by parsing it with a live tmux binary.
This commit is contained in:
2026-07-18 20:12:31 -04:00
parent 7e53ecd946
commit 80d1587189
4 changed files with 128 additions and 0 deletions

33
modules/tmux/tmux.nix Normal file
View File

@@ -0,0 +1,33 @@
{
config,
lib,
...
}:
# tmux for the primary user, configured natively through home-manager. The
# settings home-manager exposes as options are set here; every setting it has
# no option for is read verbatim from ./extra.conf. No tmux plugin manager is
# used.
let
cfg = config.modules.tmux;
user = config.user.name;
in
{
options.modules.tmux.enable = lib.mkEnableOption "tmux, configured via home-manager";
config = lib.mkIf cfg.enable {
home-manager.users.${user}.programs.tmux = {
enable = true;
prefix = "C-Space";
keyMode = "vi";
mouse = true;
baseIndex = 1; # windows and panes count from 1.
clock24 = true; # 24-hour clock in the clock-mode overlay.
escapeTime = 10; # short Esc delay so exiting insert mode in nvim isn't laggy.
historyLimit = 10000;
terminal = "tmux-256color";
extraConfig = builtins.readFile ./extra.conf;
};
};
}