Add cross-compilation support

This commit is contained in:
Kyle Finlay 2024-11-04 13:54:45 +11:00
parent db08995cd6
commit 33f50ddcca

View file

@ -43,10 +43,19 @@
outputs = srcs@{ self, ... }:
let
hostSystem = "x86_64-linux";
targetSystem = "aarch64-linux";
hostPkgs = import srcs.nixpkgs {
system = hostSystem;
};
pinned = import srcs.nixpkgs {
system = "aarch64-linux";
system = hostSystem;
crossSystem = { config = "aarch64-unknown-linux-gnu"; };
overlays = with self.overlays; [ core libcamera ];
};
in
{
overlays = {
@ -59,9 +68,10 @@
libcamera-overlay = self.overlays.libcamera;
};
nixosConfigurations = {
rpi-example = srcs.nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
rpi-example = pinned.lib.nixosSystem {
system = targetSystem;
modules = [ self.nixosModules.raspberry-pi ./example ];
pkgs = pinned;
};
};
checks.aarch64-linux = self.packages.aarch64-linux;