Here is an example of how it may look like in your configuration.nix
:
{ pkgs, ... }:
let
tmuxConfig = pkgs.callPackage (pkgs.fetchFromGitHub {
owner = "unclechu";
repo = "tmuxrc";
rev = "0000000000000000000000000000000000000000";
sha256 = "0000000000000000000000000000000000000000000000000000";
}) {};
in
{
programs.tmux = {
enable = true;
extraConfig = tmuxConfig.config;
};
# This is optional. In case you need ‘tmuxsh’ script always available.
environment.systemPackages = [
tmuxConfig.tmuxsh
];
}
nix-shell --run tmux
-
Clone this repo somewhere, say to
~/.my-tmux-config
:git clone --recursive https://github.com/unclechu/tmuxrc.git ~/.my-tmux-config
-
Create
~/.tmux/plugins
directory:mkdir -p ~/.tmux/plugins
-
Create symlink
~/.tmux/plugins/tpm
pointing to tpm directory (Tmux Plugin Manager):ln -s ~/.my-tmux-config/tpm ~/.tmux/plugins/tpm
-
Partially the configuration is provided by apps/tmuxsh script. Add it to your
PATH
environment variable (it could be.local/bin
for instance, depends on your setup) but for this usage example we will manually overridePATH
. Just make sure that this runs successfully:~/.my-tmux-config/apps/tmuxsh help
-
Either create a symlink
~/.tmux.conf
that points to .tmux.conf file:ln -s ~/.my-tmux-config/.tmux.conf ~/.tmux.conf
Or if you want to be able to add some local changes to the config create new
~/.tmux.conf
file:touch ~/.tmux.conf
And include .tmux.conf in that file and add some local changes:
source ~/.my-tmux-config/.tmux.conf set -g prefix ^B
-
Run
tmux
(PATH
is overridden fortmuxsh
script):PATH=~/.my-tmux-config/apps:$PATH tmux
And install the plugins by pressing
prefix
(Ctrl
+b
by default) +I
(capitali
,Shift
+i
)
Viacheslav Lotsmanov