uneeded builds when using binfmt for a crossSystem
I'm cross compiling a system for armv7 and trying to use disko to write an sd-card.
In the Im doing a writeShellScript that references ubootAmx335xEVM (an armv7 only build).
and adding to environment.systemPackages.
I'm using binfmt while building the sdcard
disko.imageBuilder = {
enableBinfmt = true;
pkgs = pkgs.buildPackages;
kernelPackages = pkgs.buildPackages.linuxPackages_latest;
};
When running the build (on an x86 host) the following line in make-disk-image.nix seems
to try to build ubootAmx335xEVM using x86 gcc which fails.
https://github.com/nix-community/disko/blob/8d6dd03a1cfc1783407e4f738166cab015621d21/lib/make-disk-image.nix#L123
The issue can be workaround by doing:
environment.systemPackages = lib.mkIf (pkgs.stdenv.hostPlatform == "armv7l-linux") [
update-bootloader
];
However it seems a lot of unnecary packages ar build in this situation when refrencing systemToInstallNative.config.system.build.etc just to get the udev rules.