Working with wrappers and overrideAttrs

… and this is precisely the problem that infuse solves.

Here’s the solution to OP’s problem, written as an infusion:

services.urxvtd = {
  enable = true;
  package = infuse pkgs.rxvt-unicode {
    __input.rxvt-unicode-unwrapped.
    __output.patches.
    __append = [
      ../patches/urxvt-garbage.patch
    ];
  };
};

Much nicer, right? And it says what it does; even if you don’t understand infusions you can see what it’s doing: reading from bottom to top, it appends to the patches attribute of the output of the rxvt-unicode-unwrapped input to rxvt-unicode – which is what you wanted. The fetchGit expression to give you infuse is in the comment at the top of this file.

Not in-tree as part of nixpkgs, that’s true. But infuse is the one and only tool needed for doing overrides and overlays. It subsumes all the other ones.

Also, you never need to call infuse twice, like OP has to do in “the one that works”. I can see why that’s totally confusing: why are we overriding twice in order to add one patch? Infusions compose using simple list syntax: instead of writing

infuse pkgs infusion2 (infuse pkgs infusion1)

you can instead write the following, which does exactly the same thing:

infuse pkgs [ infusion1 infusion2 ]
1 Like