gytis-ivaskevicius / nix2vim

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

Adding systemPackages in a module #2

Closed olistrik closed 9 months ago

olistrik commented 2 years ago

Hey @gytis-ivaskevicius ! You linked me to this repo on discord as an example of how to to tree-sitter grammars. I've been thinking of doing something like this for a while.

I've decided to convert my existing config to this, so far so good, only my telescope config requires ripgrep and fd. I can install them elsewhere for now but it would be really nice if it was possible to declare them within the module so that if I remove telescope, they get dropped too.

Maybe I'm missing it, but something like this would be nice I think:

{pkgs, dsl, ...}: with dsl;
{
  plugins = with pkgs:vimPlugins; [ telescope-nvim ];
  systemPackages = with pkgs; [ ripgrep fd ];

  setup.treesitter = {
    # ...
  };
}
gytis-ivaskevicius commented 2 years ago

Hey, ideally you would specify path to these executables explicitly like it's defined in telescope.nix under modules but for a while i was considering adding some sort of auto PATH generation for this, so yeah it would be nice

I'll probably will get to this at some point 😅

olistrik commented 2 years ago

like it's defined in telescope.nix

oh, I missed that. I'm pretty sure that will pull the package in correctly regardless of if it is in the systemPackages. ripgrep though isn't a dependency of a command of my own though, so I don't think that will work. Though I'm also not sure what ripgrep is a dependency of, might well be a left over from an older config.

gytis-ivaskevicius commented 9 months ago

I did not realize this before, but one may pass PATH via:

  extraMakeWrapperArgs = "--set PATH ${pkgs.lib.makeBinPath [pkgs.ripgrep pkgs.fd]}";