Add a python dependency to vim-full

Hello !

I need the python package jinja2 for a vim plugin.

I’m using NixOS, with vim-full installed like this :

packages = with pkgs; [ ... vim-full ... ];

Without vim, python isn’t in my path :

python
zsh: command not found: python
python3
zsh: command not found: python3

vim-full comes with python3 support :

:echo has('python3')
1
:py3 import sys
:py3 print(sys.version)
3.13.13 (main, Apr  7 2026, 18:19:01) [GCC 15.2.0]
:py3 print(sys.path)
['/nix/store/l9k0anq0z7zz81zcwy035jfwap9ga6rl-python3-3.13.13/lib/python313.zip', '/nix/store/l9k0anq0z7zz81zcwy035jfwap9ga6rl-python3-3.13.13/lib/python3.13', '/nix/store/l9k0anq0z7zz81zcwy035jfwap9ga6rl-python
3-3.13.13/lib/python3.13/lib-dynload', '/nix/store/l9k0anq0z7zz81zcwy035jfwap9ga6rl-python3-3.13.13/lib/python3.13/site-packages', '_vim_path_', '/home/thasos/.vim/bundle/vim-ollama/python']

How can I add the jinja2 package without installing it directly for all my system ?

Note that the vim plugin works with nix-shell -p python313Packages.jinja2 --command vim

Not sure but you can try something like this (untested):

(pkgs.vim-full.overrideAttrs (prevAttrs: {
  buildInputs = prevAttrs.buildInputs or [ ] 
  ++ [ pkgs.python313Packages.jinja2 ];
}))

Thank you for your response !
Unfortunately, the plugin doesn’t seems to find jinja2 :frowning:

Also, it would be nice not to force python version :+1:

I assume that you are using a plugin that is not available in upstream Nixpkgs.

I would create the plugin using vimUtils.buildVimPlugin and you should be able to specify the python package as a buildInput.

See here: nixpkgs/doc/languages-frameworks/vim.section.md at b0aa699cd56b87a41d3e66d89f827c7fbc35ed8d · NixOS/nixpkgs · GitHub