-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
79 lines (79 loc) · 2.48 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
description = "A small linuxboot payload for coreboot";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = inputs: {
formatter = inputs.nixpkgs.lib.mapAttrs (_: pkgs: pkgs.nixfmt-rfc-style) inputs.self.legacyPackages;
nixosModules.default = {
imports = [ ./nixos-module.nix ];
nixpkgs.overlays = [ inputs.self.overlays.default ];
};
overlays.default =
final: prev:
(
{
tinybootLoader = prev.callPackage ./pkgs/tinyboot {
withLoader = true;
withTools = false;
};
tinybootTools = prev.callPackage ./pkgs/tinyboot {
withLoader = false;
withTools = true;
};
armTrustedFirmwareMT8183 = prev.callPackage ./pkgs/arm-trusted-firmware-cros {
platform = "mt8183";
};
armTrustedFirmwareMT8192 = prev.callPackage ./pkgs/arm-trusted-firmware-cros {
platform = "mt8192";
};
armTrustedFirmwareSC7180 = prev.callPackage ./pkgs/arm-trusted-firmware-cros {
platform = "sc7180";
};
flashrom-cros = prev.callPackage ./pkgs/flashrom-cros { };
kernelPatches = prev.kernelPatches // {
ima_tpm_early_init = {
name = "ima_tpm_early_init";
patch = ./pkgs/linux/tpm-probe.patch;
};
};
}
// import ./boards.nix {
pkgs = final;
inherit (prev) lib;
}
);
legacyPackages =
inputs.nixpkgs.lib.genAttrs
[
"aarch64-linux"
"x86_64-linux"
]
(
system:
import inputs.nixpkgs {
inherit system;
overlays = [ inputs.self.overlays.default ];
}
);
devShells = inputs.nixpkgs.lib.mapAttrs (_: pkgs: {
default = pkgs.mkShell {
inputsFrom = [
pkgs.tinybootLoader
pkgs.tinybootTools
];
packages = [
pkgs.swtpm
pkgs.qemu
];
# https://github.com/NixOS/nixpkgs/issues/270415
shellHook = ''
unset ZIG_GLOBAL_CACHE_DIR
'';
env.TINYBOOT_KERNEL = ''${pkgs."tinyboot-qemu-${pkgs.stdenv.hostPlatform.qemuArch}".linux}/kernel'';
};
}) inputs.self.legacyPackages;
checks = inputs.nixpkgs.lib.mapAttrs (_: pkgs: {
disk = pkgs.callPackage ./tests/disk { };
ymodem = pkgs.callPackage ./tests/ymodem { };
}) inputs.self.legacyPackages;
};
}