devos/profiles/develop/tmux/default.nix

44 lines
853 B
Nix
Raw Normal View History

2019-12-15 08:25:04 +01:00
{ lib, pkgs, ... }:
let
2020-01-04 06:06:31 +01:00
inherit (builtins) readFile concatStringsSep;
2019-12-15 08:25:04 +01:00
2020-01-04 06:06:31 +01:00
inherit (lib) removePrefix;
2019-12-15 08:25:04 +01:00
pluginConf = plugins:
2020-07-31 06:17:28 +02:00
concatStringsSep "\n\n" (map
(plugin:
let name = removePrefix "tmuxplugin-" plugin.pname;
in "run-shell ${plugin}/share/tmux-plugins/${name}/${name}.tmux")
plugins
);
2019-12-15 08:25:04 +01:00
plugins = with pkgs.tmuxPlugins; [
copycat
open
resurrect
yank
vim-tmux-navigator
];
2020-07-31 06:17:28 +02:00
in
{
2020-01-04 06:06:31 +01:00
environment.shellAliases = { tx = "tmux new-session -A -s $USER"; };
2019-12-15 09:00:01 +01:00
2019-12-15 08:25:04 +01:00
programs.tmux = {
enable = true;
aggressiveResize = true;
escapeTime = 10;
historyLimit = 5000;
keyMode = "vi";
shortcut = "a";
terminal = "tmux-256color";
baseIndex = 1;
2020-04-27 01:45:41 +02:00
extraConfig = ''
2019-12-15 08:25:04 +01:00
${readFile ./tmuxline.conf}
${readFile ./tmux.conf}
${pluginConf plugins}
'';
};
}