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:
2026-06-12 16:36:49 -04:00
parent efc50d23c4
commit 5ee644e9dd
2 changed files with 45 additions and 0 deletions

View File

@@ -115,6 +115,7 @@
} }
# nixos-raspberrypi — crée pkgs.rpi avec kernel/firmware cross-compilés # nixos-raspberrypi — crée pkgs.rpi avec kernel/firmware cross-compilés
nixos-raspberrypi.nixosModules.nixpkgs-rpi nixos-raspberrypi.nixosModules.nixpkgs-rpi
nixos-raspberrypi.nixosModules.raspberry-pi-5.base
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
nixos-raspberrypi.overlays.bootloader nixos-raspberrypi.overlays.bootloader
@@ -130,6 +131,10 @@
nixos-uconsole.nixosModules.configtxt nixos-uconsole.nixosModules.configtxt
(nixos-uconsole.nixosModules.cm { lib = nixpkgs-uconsole.lib; isCM4 = false; }) (nixos-uconsole.nixosModules.cm { lib = nixpkgs-uconsole.lib; isCM4 = false; })
nixos-uconsole.nixosModules.base nixos-uconsole.nixosModules.base
# Cross-compile pkgs.rpi (0 QEMU)
./modules/nixos/rpi-cross-overlay.nix
# Lix instead of CppNix
{ nix.package = lix.packages."aarch64-linux".default; }
# agenix pour déchiffrer les secrets au déploiement # agenix pour déchiffrer les secrets au déploiement
agenix.nixosModules.default agenix.nixosModules.default
# Notre config # Notre config

View 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
];
};
})
];
}