-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
41 lines (35 loc) · 1.41 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
description = "A very basic flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.09";
outputs = { self, nixpkgs }: {
packages.x86_64-linux = rec {
x86-image = nixpkgs.legacyPackages.x86_64-linux.callPackage ./. {};
arm-image = let
thumbPkgs = (import nixpkgs {
system = "x86_64-linux";
crossSystem = nixpkgs.lib.systems.examples.raspberryPi // {
config = "armv6l-unknown-linux-musleabi";
isStatic = true;
};
crossOverlays = [ (import "${nixpkgs}/pkgs/top-level/static.nix") (import ./busybox-musl-overlay) (import ./small-arm.nix true) ];
});
armPkgs = (import nixpkgs {
system = "x86_64-linux";
crossSystem = nixpkgs.lib.systems.examples.raspberryPi // {
config = "armv6l-unknown-linux-musleabi";
isStatic = true;
};
crossOverlays = [ (import "${nixpkgs}/pkgs/top-level/static.nix") (import ./busybox-musl-overlay) (import ./small-arm.nix false) ];
});
in thumbPkgs.callPackage ./. {
inherit (nixpkgs.legacyPackages.x86_64-linux) qemu;
inherit armPkgs;
};
arm-kernel = arm-image.kernel;
};
defaultPackage.x86_64-linux = self.packages.x86_64-linux.arm-image;
devShell.x86_64-linux = with nixpkgs.legacyPackages.x86_64-linux; mkShell {
nativeBuildInputs = [ rpiboot-unstable ];
};
};
}