Yt-dlp requires plugins to function

This is my yt-dlp home-manager configuration:

{ config, ... }:
{
  programs = {
    yt-dlp = {
      enable = true;
      settings = {
        downloader = "aria2c";
        # See https://wiki.archlinux.org/title/Aria2#Changing_the_User_Agent
        # I tried changing the user agent but it still didn't work.
        downloader-args = "aria2c:'-c -j 3 -x 3 -s 3 -k 1M'";
        format = "bestvideo+bestaudio/best";
      };
    };

    # Aria2 in yt-dlp manages itself.
    # If you enable this, ~/.config/aria2/config will
    # be created which interferes with other yt-dlp or something.

    aria2 = {
      enable = true;
      settings = {
        continue = true;
        dir = "${config.xdg.userDirs.download}";
        file-allocation = "none";
        max-connection-per-server = 4;
        min-split-size = "5M";
        log-level = "warn";
      };
    };
  };
}

The issue is quite solvable it seems . You can find out by following thru issue discussion. Basically it requires installing one or two plugins. It’s quite easy to install the plugins. However, both plugins require some npm and npx commands, which I don’t think is pure to run on NixOS. What can we do about it?

Package whatever plugin like any other node app. See https://nixos.org/manual/nixpkgs/unstable/#language-javascript.

If you find the repo you could run nix-init (3rd party tool) and try to callPackage that.