Choose which packages to cross compile

TLDR; How can I limit the packages build for one system to only packages used by the host using that system.

As you can see in my flake.nix, I support both x86_64-linux and aarch64-linux because I deploy my raspberry pi from the same flake where my server and laptop configs are. I cross compile the packages for my raspberry pi from my laptop. The drawback is that I compile packages in aarch64 that I don’t even use on my raspberry pi. The latest such example is fprintd that tries to get built on my laptop because the build failed on hydra: Hydra - Build 253892105 of job nixpkgs:trunk:fprintd.aarch64-linux.
Obviously it fails also for me. But I don’t even use it in this architecture so it’s even more annoying lol.

Is there a way for me to say: "only cross compile packages that are going to be used by my raspberry pi host?

If you weren’t “using” it in the closure somehow, it wouldn’t try to build it. What depends on it? The build log will tell you.

I couldn’t find it: fprintd 1.94.2 build log · GitHub :thinking:

If you weren’t “using” it in the closure somehow, it wouldn’t try to build it.

Yeah, I meant that I don’t need fprintd on my raspberry pi and it’s defined nowhere in my hosts’ config.
However, I do have a package that relies on it: and I suppose it’s the culprit. But swaylock-fprintd is not used anywhere either in the config of the raspberry pi host:

My bad, I got why it’s building locally: Hydra - Build 253714077 of job nixpkgs:trunk:fprintd.x86_64-linux
The build failed for x86 too, I missed it.