How to upgrade one Node package?

I’m trying to get a newer version of bitwarden-cli - 1.6.0 instead of 1.5.1 - and I’m having a hard time doing so.

I have identified the pkgs/development/node-packages/generate.sh script that generates the pkgs/development/node-packages/node-packages.nix file and ran it, in result getting an updated @bitwarden/cli. But I’m not sure how to apply it to my own NixOS configuration.

I have tried the overlay approach by doing this:

{
  nixpkgs.overlays = [
    (final: prev: {
      bitwarden-cli = prev.lib.overrideDerivation prev.bitwarden-cli (drv: {
        version = "1.16.0";
        src = prev.fetchurl {
          url = "https://registry.npmjs.org/@bitwarden/cli/-/cli-1.16.0.tgz";
          sha512 = "HWQnOa3TzRJcF/TVKGWqzFP9PVaG6IhCBzFVY2tZ5mITNAf1nb2aC+gzH2EMa1m41IV6knPuXpqnsVGJGqQuxg==";
        };
        dependencies = [
          sources."abab-2.0.5"
          ...omitted...
          sources."zxcvbn-4.4.2"
        ];
      });
    })
  ];
}

But it complains that it doesn’t know where to get sources:

error: undefined variable 'sources' at /etc/nixos/roles/overlay.nix:11:11

But sources is available within node-packages.nix generated by generate.sh. I tried supplying it via:

let
  sources = pkgs.nodePackages;
in ...

But that fails because it’s missing specific sources:

error: attribute 'abab-2.0.5' missing, at /etc/nixos/roles/overlay.nix:11:7-

Does this mean I have to replace the whole contents of node-package.nix to make this work?
How should that be done?

I have managed to get this working with this hack solution:

{
  nixpkgs.overlays = [
    (final: prev: {
      nodePackages = (import /home/jakubgs/work/nixpkgs { }).nodePackages;
    })
  ];
}

Which does work, but it’s ugly, and would not work on any other host unless a modified clone of nixpkgs existed in the same place on that system. Is there a proper way of doing this? On that I can commit into my nixos configuration repo?