I’d like to be able to specify a cross-compile target like lib.system.examples.iphone64 , so it would be possible to do nix-build -A pkgsCross.someNewThing.hello . I tried adding an overlay to my project that would override lib, merging with existing examples using // but this didn’t seem to add a new cross-compile overlay.
No, I mean like adding another thing to lib.systems.examples so I could use iphone64New instead of iphone64. I submitted a PR some time ago to update things to current versions but this hasn’t moved since then (darwin: update xcode versions by spease · Pull Request #100687 · NixOS/nixpkgs · GitHub) so I’m just working around it with an overlay now.
@jonringer I’m not sure that would work, as pkgsCross are populated via the lib argument that is passed into the lib stage function, which is imported directly relatively to pkgs:
My understanding thus far is that overlaying the lib like you propose would have no relevance when the stdenv is constructed, hence would not produce a new, functioning cross target.
@jonringer Your example is very close to what I was trying initially, except I was going through each level of the hierarchy and using //. But yeah, I tried your approach too and it didn’t seem to change anything.
More precisely, pkgs.path points to the root of the nixpkgs filesystem three you are currently in.
(Actually, it might have to be prev.path in the code sample above)
Sorry I didn’t reply to this - I ended up having to abandon nix as a solution for management of the iPhone apps for this project. My PR did eventually get accepted however. Though, then there were more obstacles as I don’t think anyone has really been maintaining iPhone development.