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, ... }:

let
  python = pkgs.python39;
  nodejs = pkgs.nodejs-16_x;
in
{
  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; [
      vim-airline
      tokyonight-nvim
    ];
    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 https://github.com/nix-community/home-manager/pull/3194 .
what could be helpful is to pass a nodeEnv instead of withNode https://github.com/teto/nixpkgs/blob/75166c0ba937565478bf30cc07e7f87463399a2f/pkgs/applications/editors/neovim/utils.nix#L86 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