-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
62 lines (51 loc) · 1.69 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
flake-utils.url = github:numtide/flake-utils;
aarch-images = {
url = "github:Mic92/nixos-aarch64-images";
flake = false;
};
uboot = {
url = "github:u-boot/u-boot";
flake = false;
};
};
outputs = inputs@{ self, flake-utils, nixpkgs, uboot, aarch-images }:
let
buildImage = pkgs.callPackage "${aarch-images}/pkgs/build-image" { };
pkgs = import nixpkgs { system = "aarch64-linux"; };
in
flake-utils.lib.eachDefaultSystem (_: rec {
packages.sdImage = (import "${nixpkgs}/nixos" {
configuration = ./sd.nix;
inherit (pkgs) system;
}).config.system.build.sdImage;
packages.uboot = pkgs.buildUBoot rec {
extraMakeFlags = [ "all" "u-boot.itb" ];
defconfig = "nanopi-r2s-rk3328_defconfig";
extraMeta = {
platforms = [ "aarch64-linux" ];
license = pkgs.lib.licenses.unfreeRedistributableFirmware;
};
enableParallelBuilding = true;
src = uboot;
version = uboot.rev;
BL31 = "${pkgs.armTrustedFirmwareRK3328}/bl31.elf";
filesToInstall = [ "u-boot.itb" "idbloader.img" ];
};
packages.aarch64Image = pkgs.stdenv.mkDerivation {
name = "sd-test";
version = "1.0.0";
src = packages.sdImage;
phases = [ "installPhase" ];
noAuditTmpdir = true;
preferLocalBuild = true;
installPhase = "ln -s $src/sd-image/*.img $out";
};
defaultPackage = pkgs.callPackage "${aarch-images}/images/rockchip.nix" {
inherit buildImage;
inherit (packages) uboot aarch64Image;
};
});
}