mirror of
https://github.com/nix-community/raspberry-pi-nix.git
synced 2025-11-08 11:36:04 +01:00
Add cross-compilation support
This commit is contained in:
parent
db08995cd6
commit
33f50ddcca
1 changed files with 13 additions and 3 deletions
16
flake.nix
16
flake.nix
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue