feat(uconsole): add rpi-cross-overlay module + Lix
- rpi-cross-overlay.nix: override pkgs.rpi with cross-compilation when buildPlatform != hostPlatform (0 QEMU) - Lix nix daemon for uConsole (aarch64-linux) - Remove broken inline overlay from flake.nix
This commit is contained in:
40
modules/nixos/rpi-cross-overlay.nix
Normal file
40
modules/nixos/rpi-cross-overlay.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
# rpi-cross-overlay.nix
|
||||
#
|
||||
# Override pkgs.rpi to cross-compile when buildPlatform != hostPlatform.
|
||||
#
|
||||
# By default, nixos-raspberrypi's nixpkgs-rpi module creates pkgs.rpi via
|
||||
# mkRpiPkgs which imports nixpkgs with system="aarch64-linux" — a NATIVE
|
||||
# aarch64 build that requires QEMU on x86_64 builders.
|
||||
#
|
||||
# This module detects cross-compilation (buildPlatform != hostPlatform) and
|
||||
# re-imports pkgs.rpi using localSystem (builder) + crossSystem (target) so
|
||||
# that kernel, firmware, and rpi-optimized packages are genuinely cross-compiled
|
||||
# with zero QEMU emulation.
|
||||
#
|
||||
# Once nixos-raspberrypi upstream supports buildPlatform natively in mkRpiPkgs,
|
||||
# this module can be removed.
|
||||
|
||||
{ config, lib, pkgs, nixos-raspberrypi, ... }:
|
||||
|
||||
let
|
||||
inherit (config.nixpkgs) buildPlatform hostPlatform;
|
||||
isCross = buildPlatform.system != hostPlatform.system;
|
||||
in
|
||||
lib.mkIf isCross {
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
rpi = import pkgs.path {
|
||||
localSystem = { system = buildPlatform.system; };
|
||||
crossSystem = { system = hostPlatform.system; };
|
||||
overlays = with nixos-raspberrypi.overlays; [
|
||||
bootloader
|
||||
vendor-kernel
|
||||
vendor-firmware
|
||||
kernel-and-firmware
|
||||
vendor-pkgs
|
||||
pkgs
|
||||
];
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user