mirror of
https://github.com/nix-community/raspberry-pi-nix.git
synced 2025-11-08 19:46:03 +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, ... }:
|
outputs = srcs@{ self, ... }:
|
||||||
let
|
let
|
||||||
|
hostSystem = "x86_64-linux";
|
||||||
|
targetSystem = "aarch64-linux";
|
||||||
|
|
||||||
|
hostPkgs = import srcs.nixpkgs {
|
||||||
|
system = hostSystem;
|
||||||
|
};
|
||||||
|
|
||||||
pinned = import srcs.nixpkgs {
|
pinned = import srcs.nixpkgs {
|
||||||
system = "aarch64-linux";
|
system = hostSystem;
|
||||||
|
crossSystem = { config = "aarch64-unknown-linux-gnu"; };
|
||||||
overlays = with self.overlays; [ core libcamera ];
|
overlays = with self.overlays; [ core libcamera ];
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
overlays = {
|
overlays = {
|
||||||
|
|
@ -59,9 +68,10 @@
|
||||||
libcamera-overlay = self.overlays.libcamera;
|
libcamera-overlay = self.overlays.libcamera;
|
||||||
};
|
};
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
rpi-example = srcs.nixpkgs.lib.nixosSystem {
|
rpi-example = pinned.lib.nixosSystem {
|
||||||
system = "aarch64-linux";
|
system = targetSystem;
|
||||||
modules = [ self.nixosModules.raspberry-pi ./example ];
|
modules = [ self.nixosModules.raspberry-pi ./example ];
|
||||||
|
pkgs = pinned;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
checks.aarch64-linux = self.packages.aarch64-linux;
|
checks.aarch64-linux = self.packages.aarch64-linux;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue