Install neovim with specific node version

I’m trying to install neovim with node 16.x via home-manager.

my home.nix looks like:

{ config, pkgs, ... }:

  python = pkgs.python39;
  nodejs = pkgs.nodejs-16_x;
  home.username = "jo";
  home.homeDirectory = "/Users/jo"
  home.stateVersion = "22.11";
  home.packages = [ python nodejs ];

  programs.neovim = {
    enable = true;
    viAlias = true;
    vimAlias = true;
    vimdiffAlias = true;
    withNodeJs = true;
    plugins = with pkgs.vimPlugins; [
    coc = {
      enable = true;
    extraConfig = ''
      set number
      set relativenumber
      set autoindent
      set mouse=a
      set encoding=UTF-8
      set autoindent
      set smartindent
      set shiftwidth=4
      set softtabstop=4
      set expandtab
      syntax enable
      colorscheme tokyonight
      filetype plugin indent 

But when I home-manager switch, it uses node v18.9.0 to install neovim.

It seems overlays can be used to fix node version, but I’m a nix-newbie and that overlay concept is quite hard to get it…

seems like a recurrent issue .
what could be helpful is to pass a nodeEnv instead of withNode so that we can set the “let g:${prog}_host_prog” to the correct env instead. Anyone feel free to do so.

I see.
I’d take a look another time