Best practice - mitigating upstream bugs in my own config

Hello there,
I got a bug to workaround with the gotenberg service.
the issue is already known and the fix is waiting to be merged I guess… gotenberg doesn't utilize extraArgs · Issue #340447 · NixOS/nixpkgs · GitHub

Anyways, as outlined in the report there… is there a way for me to workaround that problem in my config while I am waiting for the upstream fix?

I tried something like this, but that doesnt work:

  services.gotenberg = {
    enable = true;
    libreoffice.autoStart = true;
    extraArgs = [ "--api-bind-ip=127.0.0.1" ];
    args = config.services.gotenberg.args ++ config.services.gotenberg.extraArgs;
  };

I guess the easiest one is to set up an overlay. But, lacking the proper idiom, that feels like shooting ants…

Sadly the problem is precisely that extraArgs isn’t hooked up to anything.

If this were a package, yeah, an overlay could help, but those don’t do anything to modules.

Since args is not exposed in any option, you can’t depend on the module args without a recursive definition of ExecStart. You’re kinda stuck here.

You have two options:

  1. Copy out the literal definition of args into your config and set the ExecStart to use it with lib.mkForce
  2. Add a dependency on nixpkgs-unstable, remove the module from your stable nixpkgs, and frankenstein in the unstable module with an imports

The latter is quite complex, and probably will not work in this case, since it introduces further changes to work around a breaking change in this package.

The former is inelegant as hell, but it’ll probably tide you over untile June, when you can just update and remove the hack…

Finally you could write a PR to backport actually making etraArgs work, at which point your current definition would work.

Oh wow! thank you!
I applied the first proposal and its working to produce a fine systemd unit.

But funny enough, that version of gotenberg in nixpkgs 24.11 (v8.9.1) doesnt have that flag yet.
It was added in Release 8.12.0 · gotenberg/gotenberg · GitHub
Sooooo I can’t apply it in anyway - haha :slight_smile:

Case closed. Oooh and thank you! really appreciated <3