I created a custom derivation for simplifying macOS gui applications awhile back. However, I didn’t upstream it due to wanting to refine it a bit, and it seems my method of overlaying it onto nixpkgs is no longer working.
while evaluating 'makeOverridable' at /nix/store/bxsfsmq1jcqd6xkawlw545g6r5cr62f2-nixpkgs-21.11pre318361.a3a23d9599b/nixpkgs/lib/customisation.nix:67:24, called from /nix/store/bxsfsmq1jcqd6xkawlw545g6r5cr62f2-nixpkgs-21.11pre318361.a3a23d9599b/nixpkgs/lib/customisation.nix:121:8:
while evaluating anonymous function at /Users/spease/.nixpkgs/overlays/carthage.nix:1:1, called from /nix/store/bxsfsmq1jcqd6xkawlw545g6r5cr62f2-nixpkgs-21.11pre318361.a3a23d9599b/nixpkgs/lib/customisation.nix:69:16:
attribute 'installApplication' missing, at /Users/spease/.nixpkgs/overlays/carthage.nix:3:1
Anyone know what the right way to add a field to nixpkgs.darwin is now?
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.
Using that has gotten me to the type error again I mentioned in the other thread. If I just comment out meta.maintainers then I get:
building the system configuration...
error: value is a set while a list was expected
52| hasNoMaintainers = attrs:
53| attrs ? meta.maintainers && (lib.length attrs.meta.maintainers) == 0;
(use '--show-trace' to show detailed location information)
That sounds like not using overrideScope' was indeed the issue. I would suggest continuing the debugging in the other thread as to not split the attention of the community into multiple places for solving the same issue.
P.S. You will want to post more context, including the full trace and the place where buildApplication is actually used.