reciproka-ops/profiles/tmux.nix

47 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2021-10-07 02:13:48 +00:00
# Common configuration for Tmux users
{
2022-07-18 05:34:09 +00:00
config,
pkgs,
...
2022-07-18 05:45:17 +00:00
}: let
cfg = config.programs.tmux;
in {
2021-10-07 02:13:48 +00:00
programs = {
2022-07-18 05:34:09 +00:00
tmux = {
# Terminal multiplexer required by byobu
2021-10-07 02:13:48 +00:00
enable = true;
aggressiveResize = true;
clock24 = true;
extraConfig = ''
2022-07-18 05:45:17 +00:00
POWERLINE_COMMAND="/run/current-system/sw/bin/powerline"
POWERLINE_CONFIG_COMMAND="/run/current-system/sw/bin/powerline-config"
run-shell "/run/current-system/sw/bin/powerline-daemon -q"
source /run/current-system/sw/share/tmux/powerline.conf
2021-10-07 02:13:48 +00:00
# Bind home and end keys:
bind-key -n Home send Escape "OH"
bind-key -n End send Escape "OF"
2022-07-18 05:45:17 +00:00
# Run tmux plugins in NixOS
run-shell ${pkgs.tmuxPlugins.onedark-theme}/share/tmux-plugins/onedark-theme/tmux-onedark-theme.tmux
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
2021-10-07 02:13:48 +00:00
'';
2022-07-18 05:34:09 +00:00
keyMode = "vi";
2021-10-07 02:13:48 +00:00
newSession = true;
2022-07-18 05:45:17 +00:00
shortcut = "b";
2022-07-18 05:34:09 +00:00
terminal = "screen-256color";
2021-10-07 02:13:48 +00:00
};
};
environment.systemPackages = with pkgs; [
2022-07-18 05:45:17 +00:00
powerline
2021-10-07 02:13:48 +00:00
tmuxPlugins.continuum
2022-07-18 05:45:17 +00:00
tmuxPlugins.onedark-theme
2021-10-07 02:13:48 +00:00
tmuxPlugins.resurrect
tmuxPlugins.sensible
tmuxPlugins.tmux-fzf
tmuxPlugins.yank
];
}