Hey folks, long time reader, first time poster! Just made an account for this
Anyway, I’m tryign to setup this tmux plugin that’s not available in nixpkgs called tmux-window-name which automatically changes window names depending on which application you’ve got open, which file in nvim is open, etc. Its really useful!
Anyway, I’ve got a custom tmux plugin i’m using as input to the rest of my tmux config like this:
{ pkgs, input, ... }:
let
tmux-window-name = pkgs.tmuxPlugins.mkTmuxPlugin {
pluginName = "tmux-window-name";
version = "2024-03-08";
src = pkgs.fetchFromGitHub {
owner = "ofirgall";
repo = "tmux-window-name";
rev = "34026b6f442ceb07628bf25ae1b04a0cd475e9ae";
sha256 = "sha256-BNgxLk/BkaQkGlB4g2WKVs39y4VHL1Y2TdTEoBy7yo0=";
};
postInstall = ''
find $target -type f -print0 | xargs -0 sed -i -e 's|python3 |${pkgs.python3}/bin/python3 |g'
'';
rtpFilePath = "tmux_window_name.tmux";
};
in
Separately, I have these python packages installed:
{ pkgs, input, ... }:
{
environment.systemPackages = with pkgs; [
python311Full
python311Packages.requests
python311Packages.libtmux
python311Packages.pip
python311Packages.pipx
];
}
The tmux plugin tmux-window-name
gets installed correctly, but then when I go to reload tmux and use it, it does some odd manual checking with pip
to ensure that libtmux
is available in their tmux_window_name.tmux file (i.e. like python3 -m pip list
). And this is where it’s throwing and exiting.
If I take the generated command out of the final tmux_window_name.tmux
file in my store and run it (/nix/store/8k4p193rnzy3rqjkv19abz3b738l25z9-python3-3.11.6/bin/python3 -m pip list
) I get an error message: no module named pip
.
I also saw some other packages in tmuxPlugins
do a wrapProgram
thing where they make a few separate programs available in 1 which sounds kinda like what I’m trying to accomplish here, but I’ve just seen that for the first time and have no idea if it might work here.
Anyway, long story short - does any one have any examples of a tmux plugin derivation which uses python and libtmux
and how to wire that all up together with the nix store paths?