It would be good if you also posted the full trace code of carthage.nix
since that is where the error comes from.
Looking at pkgs/top-level/all-packages.nix
:
The darwin
attribute is defined in pkgs/top-level/darwin-packages.nix
, which reveals it is a scope:
If you want to replace a scope, you should use its overrideScope'
function, otherwise other packages inside will not be aware of the new package.
Now, this should not matter in your case since you are only using the attribute from outside of the scope but it is a good practice to use the proper overriding mechanism in case the requirements change in the future.
It is not actually clear to me why your code does not work but I have not actually looked into how splicing works, especially with overlays and scopes so maybe not using overrideScope
can confuse the splicing mechanism.