Creating an overlay for neovim

Hello! I’m new to Nixos and one of the thorniest sticking points has been configuring neovim back to the way I’m used to. I tried out nixvim and nvf, but ultimately decided that the home manager’s baseline way of handling plugins fit best. Now all of my config looks like this:

programs.neovim.plugins = with pkgs.vimPlugins; [
  {
    plugin = nvim-autopairs;
    type = "lua";
    config = /* lua */ "require('nvim-autopairs').setup({})";
  }
];

The above code works, but it’s redundant to keep adding type = "lua"; when all of my config is in lua. I looked to see if there was a way to change the default type for neovim plugins (which is defined in a submodule within the neovim package) and stumbled on the concept of overlays. Ever since, I’ve been stuck. It seems like such a small change should be simple, but at this point I’ve tried seemingly every combination of overrides, overlays, and submodules to no success.

Is there something I’m missing here?

Using builtins.map on a list of attrsets would be the simplest option IMO. You could even create a new option.

Overlays are unrelated, those are for modifying attributes in a nixpkgs instance, not modifying module options.