gytis-ivaskevicius / nix2vim

[WIP] Nix to Lua parser meant to be used for configuring neovim
MIT License
51 stars 5 forks source link

Unable to add extra python package dependencies via `extraPython3Packages` #3

Closed Danielhp95 closed 2 years ago

Danielhp95 commented 2 years ago

Thanks a lot for this flake, it really helped setting up my nvim in nix!

as part of the neovimBuilder call I am trying to add a python package, namely ueberzug. I try to add it by passing a reference to it in the neovimBuilder option extraPython3Packages. I am unable to either find the

...
extraPython3Packages = (ps: with ps; [ ueberzug ]);
...

However this fails to propagate the dependency. Am I doing something wrong or is the functionality of the option extraPython3Packages not working correctly?

Thanks a lot for your time!

gytis-ivaskevicius commented 2 years ago

is python support enabled? And how may I test this package?

Danielhp95 commented 2 years ago

Yes, python support is enabled via setting the option withPython3 = true. I test this by being (1) being able to call the :python command from nvim and (2) also by seeing that pynvim is indeed installed. To try (2) I run :python import pynvim; print(pynvim) as an nvim command and I get the following output:

<module 'pynvim' from '/nix/store/8r385ykj81fkf01p07wh750r345978ld-python3-3.9.13-env/lib/python 3.9/site-packages/pynvim/__init__.py'>.

That's good news! Let's use a slimer package for testing, like the requests package.

If I now add extraPython3Packages = (ps: with ps; [ requests ]); to my neovimBuilder, rebuild nvim and then call :python import requests; print(requests), I get an ModuleNotFoundError, as per my initial comment.

Here's my initial take: Are you sure that pythonEnv is executed properly ?

gytis-ivaskevicius commented 2 years ago

Yeah, I did not mean to but I think I accidentally fixed it :sweat_smile: https://github.com/gytis-ivaskevicius/nix2vim/commit/b52f028f5d0d7aea646fbdd5389d887b81c025e6