-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
88 lines (81 loc) · 2.52 KB
/
Copy pathflake.nix
File metadata and controls
88 lines (81 loc) · 2.52 KB
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
80
81
82
83
84
85
86
87
88
{
description = "A kexec-based bootloader";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.zig-overlay.url = "github:mitchellh/zig-overlay";
inputs.zig-overlay.inputs.nixpkgs.follows = "nixpkgs";
outputs =
inputs:
let
inherit (builtins) listToAttrs mapAttrs;
inherit (inputs.nixpkgs.lib) genAttrs;
in
{
nixosModules.default = {
imports = [ ./nixos ];
nixpkgs.overlays = [ inputs.self.overlays.default ];
};
overlays.default = final: _prev: {
tinyboot = final.callPackage ./package.nix {
zig = inputs.zig-overlay.packages.${final.stdenv.buildPlatform.system}.master;
};
};
legacyPackages = genAttrs [ "aarch64-linux" "x86_64-linux" ] (
system:
import inputs.nixpkgs {
inherit system;
overlays = [ inputs.self.overlays.default ];
}
);
devShells = mapAttrs (system: pkgs: {
default = pkgs.mkShell {
packages = [
inputs.zig-overlay.packages.${system}.master
pkgs.lldb
pkgs.qemu
pkgs.swtpm
];
env.TINYBOOT_KERNEL =
with inputs.self.checks.${system}.disk.nodes.machine.system;
"${build.tinybootKernel}/${boot.loader.kernelFile}";
};
}) inputs.self.legacyPackages;
checks = mapAttrs (
_system: pkgs:
{
disk = pkgs.callPackage ./tests/disk { };
efiStub = pkgs.callPackage ./tests/efi-stub { };
kexecLoad = pkgs.callPackage ./tests/kexec-load { };
ymodem = pkgs.callPackage ./tests/ymodem { };
tinybootNative = pkgs.tinyboot;
}
// listToAttrs (
map
(
system:
let
pkgs' =
pkgs.pkgsCross.${
{
"riscv64-linux" = "riscv64";
"x86_64-linux" = "gnu64";
"aarch64-linux" = "aarch64-multiplatform";
"armv7l-linux" = "armv7l-hf-multiplatform";
}
.${system}
};
in
{
name = "tinybootCross-${pkgs'.stdenv.hostPlatform.qemuArch}";
value = pkgs'.tinyboot;
}
)
[
"armv7l-linux"
"aarch64-linux"
"x86_64-linux"
]
)
) inputs.self.legacyPackages;
hydraJobs = inputs.self.checks;
};
}