nix: Add tmux

This commit is contained in:
Geoffrey Frogeye 2023-11-20 22:09:28 +01:00
parent d0c743ec30
commit 5d5750b2db
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
3 changed files with 31 additions and 18 deletions

View file

@ -117,7 +117,6 @@ in
gdb = "gdb -x ${config.xdg.configHome}/gdbinit";
iftop = "iftop -c ${config.xdg.configHome}/iftoprc";
lmms = "lmms --config ${config.xdg.configHome}/lmmsrc.xml";
tmux = "tmux -f ${config.xdg.configHome}/tmux/tmux.conf";
# Preference
vi = "nvim";
@ -310,6 +309,31 @@ in
};
extraConfig = builtins.readFile ./inputrc;
};
tmux =
let
themepack = pkgs.tmuxPlugins.mkTmuxPlugin
rec {
pluginName = "tmux-themepack";
version = "1.1.0";
rtpFilePath = "themepack.tmux";
src = pkgs.fetchFromGitHub {
owner = "jimeh";
repo = "tmux-themepack";
rev = "${version}";
sha256 = "f6y92kYsKDFanNx5ATx4BkaB/E7UrmyIHU/5Z01otQE=";
};
};
in
{
enable = true;
mouse = false;
clock24 = true;
# TODO Vim mode?
plugins = with pkgs.tmuxPlugins; [
sensible
];
extraConfig = builtins.readFile ./tmux.conf + "source-file ${themepack}/share/tmux-plugins/tmux-themepack/powerline/default/green.tmuxtheme\n";
};
};
services = {
gpg-agent = {

View file

@ -28,8 +28,11 @@ in
};
};
targets.vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR)
# targets.i3.enable = false; # I prefer my own styles
targets = {
vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR)
i3.enable = false; # I prefer my own styles
tmux.enable = false; # Using another theme
};
};
# Fix https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal
@ -37,4 +40,5 @@ in
dconf.enable = false; # Otherwise standalone home-manager complains it can't find /etc/dbus-1/session.conf on Arch.
# Symlinking it to /usr/share/dbus-1/session.conf goes further but not much.
}

View file

@ -9,24 +9,9 @@ bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
set -g mouse off
# https://superuser.com/a/1007721
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
# Inform tmux that alacritty supports RGB
# (because for some reason terminfo doesn't?)
set -ga terminal-overrides ',alacritty*:RGB'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'jimeh/tmux-themepack'
set -g @themepack 'powerline/block/green'
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.cache/tmuxplugins/'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
if "test ! -d ~/.cache/tmuxplugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.cache/tmuxplugins/tpm && ~/.cache/tmuxplugins/tpm/bin/install_plugins'"
run -b '~/.cache/tmuxplugins/tpm/tpm'