But that does not seem to change anything.
I also tried printing the oldAttrs variable using builtins.trace, but the printed set does not contain any of the parameters of the octoprint package.
Turns out I need override instead of overrideAttrs, but I don’t really get why.
I thought overrideAttrs was for parameters and override for members of the resulting package…
It is the other way around. overrideAttrs modifies the attributes passed to stdenv.mkDerivation, while override modifies the arguments passed to the package function by lib.callPackage.
There are some other attribute sets that contain different override function, for example, python3.pkgs.buildPythonPackage uses overridePythonAttrs, stuff created using lib.makeOverridable like the packages in nodePackages use override (this is probably where your confusion comes from)…