-
-
Notifications
You must be signed in to change notification settings - Fork 78
add kernel cross build support for faster builds on x86_64-linux #98
base: master
Are you sure you want to change the base?
Conversation
This adds the option `raspberry-pi-nix.kernel-build-system`, which can be used to drastically decrease the build times. Description of the option: The build system to compile the kernel on. Only the linux kernel will be cross compiled, while most of the derivations are still pulled from cache.nixos.org. Use this if you cannot or don't want to use the nix-community cache and either: - you are building on an x86_64 system using binfmt_misc for aarch64-linux. - or if your x86_64 builder has a better CPU than your aarch64 builder.
Damn, there still seems to be an error building modules-shrunk:
|
Actually this problem was unrelated, and due to a mix of different nixpkgs in my config. |
I think this is good to go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This worked for me, thanks!
rpi-kernels = builtins.foldl' | ||
(b: a: final.lib.recursiveUpdate b (rpi-kernel a)) | ||
{ }; | ||
|
||
rip-kernels-cross = buildSystem: builtins.foldl' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is supposed to say rpi-kernels-cross
In my configurations, I use something like this: final: prev:
let
inherit (final) lib;
in
{
pkgsUncross = lib.flip lib.mapAttrs final.lib.systems.examples (
_: localSystem:
import final.path {
inherit (final) config overlays;
inherit localSystem;
crossSystem = final.hostPlatform;
}
);
} Which allows me to just set nixpkgs.hostPlatform = lib.recursiveUpdate (lib.systems.elaborate lib.systems.examples.aarch64-multiplatform) {
linux-kernel.target = "vmlinuz.efi";
linux-kernel.installTarget = "zinstall";
}; But I'm sure there's other, less obscure edge cases. I've thought about upstreaming |
This adds the option
raspberry-pi-nix.kernel-build-system
, which can be used to drastically decrease the build times.Description of the option:
The build system to compile the kernel on.
Only the linux kernel will be cross compiled, while most of the derivations are still pulled from cache.nixos.org.
Use this in any of these cases: