Concatenating arrays with `recursiveUpdate`

Hi, I’d like to set up rnnoise as the pipewire documentation does.

The boilerplate mentioned there and a couple of extra neat things are already set in the default config, so ideally, I’d just need to add:

    config.pipewire = {
      "context.modules" = [{
        args = {
          node.name = "rnnoise_source";
          node.description = "Noise Canceling source";
          media.name = "Noise Canceling source";
          filter.graph = {
            nodes = [{
              type = "ladspa";
              name = "rnnoise";
              plugin = "${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so";
              label = "noise_suppressor_stereo";
              control = { "VAD Threshold (%)" = 50.0; };
            }];
          };
          capture.props = { node.passive = true; };
          playback.props = { media.class = "Audio/Source"; };
        };
      }];
    };

Sadly, this seems to completely wipe the default modules config, which seems to be what recursiveUpdate does. The default config is defined here.

Is this an oversight by the module author? If so, what should that function be, so that I can patch it? Is there something else I can do?

Seeing as it provided a “default”. I would say that expected behavior would be to see what you explicit set.

If you really wanted to, you could recreate the logic and do a mkMerge.

Hrm, I do understand that reasoning, but the configuration here is fairly complex. Rolling your own means having to maintain it manually for what is hopefully a fairly small change.

I’d like to avoid that, largely because I don’t yet fully understand pipewire and because it’s moving fast enough I imagine there will be some very sensible changes to make in the future I’d otherwise miss.

mkMerge is what I’m looking for though, I think. I’ll try figuring out how to best override that in config for now, thanks :slight_smile: