wrapMpv removed - syntax for setting package options needed (mpv, nixos-unstable)

I’ve had a mpv config for a while that enables vapoursynth and youtube support:

(wrapMpv (pkgs.mpv-unwrapped.override { vapoursynthSupport = true; }) { youtubeSupport = true; })

With recent commits of nixos-unstable, this no longer works:

 error: undefined variable 'wrapMpv'

nixos-unstable has this commit: mpv: move wrapper under mpv-unwrapped.passthru · NixOS/nixpkgs@cc419c0 · GitHub

which seems to indicate I should use mpv-unwrapped.wrapper instead, but it fails with:

error: function 'wrapper' called without required argument 'mpv'

I tried adding mpv and pkgs.mpv as the second argument to mpv-unwrapped.wrapper, but I’m assuming this needs to be set elsewhere because it gives the same error as above.

(mpv-unwrapped.wrapper pkgs.mpv (pkgs.mpv-unwrapped.override { vapoursynthSupport = true; }) { youtubeSupport = true; })

I’m not really sure where the first argument of mpv to mpv-unwrapped.wrapper is supposed to be set (or even if this is an option representing a package) so any help in a working configuration would be greatly appreciated.

It now uses attributes instead of ordered arguments. So something like this should work:

pkgs.mpv-unwrapped.wrapper {
  mpv = pkgs.mpv-unwrapped.override { vapoursynthSupport = true; };
  youtubeSupport = true;
};

Here’s my config with something similar.