Latexmk not finding my installed packages

Currently I’m trying to get the vimtex plugin working with neovim and my local installation of texlive. The vimtex plugin (by default) uses the following command to compile a document:

latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf file.tex

When I run this command in my terminal on a document I want to compile, everything works as expected. I get the appropriate pdf output with no errors. However, when I open neovim with vimtex and compile from within neovim, I get the errors:

main.tex|| File `darkmode.sty' not found.
main.tex|3 error| Emergency stop.
main.tex|3 error| Fatal error occurred, no output PDF file produced!

This behavior is with the texliveFull package from nixpkgs installed. However, I get the same behavior when I try to install the problem package with:

 (texlive.withPackages (ps: with ps; [
      darkmode
      latexmk
      # other packages
    ]))

Is there something I might be missing about how to install packages for latex?

I figured out the issue. I use NixVim to configure my neovim. So, when I use NixVim to enable the vimtex plugin (programs.nixvim.plugins.vimtex.enable = true), I also needed to specify the texlivePackage the vimtex would use (texlivePackage = pkgs.texliveFull). Without this second line, I guess vimtex just doesn’t know what to do? I’m not really sure, but that’s what fixed it for me.