nixos-config/modules/programs/tmux/default.nix

65 lines
2.0 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2021-07-29 20:21:51 +00:00
let
cfg = config.ptw.programs.tmux;
in {
options.ptw.programs.tmux = {
enable = lib.mkEnableOption "Enable and configure tmux using HomeManager";
};
config = lib.mkIf cfg.enable {
2021-08-04 17:07:42 +00:00
environment.systemPackages = [ pkgs.tmux ];
home-manager.users."${config.ptw.system.singleUser}".programs.tmux = {
2021-08-04 17:07:42 +00:00
enable = true;
extraConfig = ''
set -g mouse on
set -g history-limit 1000
setw -g monitor-activity on
set -g visual-activity on
bind r source-file ~/.config/tmux/config
## Status bar design
# status line
set -g status-justify left
set -g status-interval 2
# window status
setw -g window-status-format " #F#I:#W#F "
setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
# Info on left (I don't have a session display for now)
set -g status-left ""
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
set -g default-terminal "screen-256color"
# The modes {
setw -g clock-mode-colour colour135
# }
# The statusbar {
set -g status-position bottom
set -g status-left ""
set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
# }
2021-07-29 20:21:51 +00:00
'';
2021-08-04 17:07:42 +00:00
};
2021-07-29 20:21:51 +00:00
};
}