This commit is contained in:
2022-11-28 00:52:18 -05:00
parent c66f8ef8d4
commit a3f59d1e0e
24 changed files with 7795 additions and 666 deletions

View File

@@ -1,18 +1,12 @@
{ config, pkgs, lib, ... }:
let
buildPkgs = if config.boot.kernelBuildIsCross then
import (pkgs.path) {
system = "x86_64-linux";
crossSystem.system = "aarch64-linux";
}
else pkgs;
bootM1n1 = buildPkgs.callPackage ../m1n1 {
bootM1n1 = config.hardware.asahi.pkgs.callPackage ../m1n1 {
isRelease = true;
withTools = false;
customLogo = config.boot.m1n1CustomLogo;
};
bootUBoot = buildPkgs.callPackage ../u-boot {
bootUBoot = config.hardware.asahi.pkgs.callPackage ../u-boot {
m1n1 = bootM1n1;
};
@@ -34,23 +28,26 @@ in {
# ensure the installer has m1n1 in the image
system.extraDependencies = lib.mkForce [ bootM1n1 bootUBoot ];
# give the user the utilities to re-extract the firmware if necessary
environment.systemPackages = [
(buildPkgs.callPackage ../asahi-fwextract {})
];
# system.extraDependencies = [ boot ];
# system.extraDependencies = lib.mkForce [ boot ];
system.build.m1n1 = bootFiles."m1n1/boot.bin";
};
options.boot.m1n1ExtraOptions = lib.mkOption {
type = lib.types.str;
default = "";
description = ''
Append extra options to the m1n1 boot binary. Might be useful for fixing
display problems on Mac minis.
https://github.com/AsahiLinux/m1n1/issues/159
'';
options.boot = {
m1n1ExtraOptions = lib.mkOption {
type = lib.types.str;
default = "";
description = ''
Append extra options to the m1n1 boot binary. Might be useful for fixing
display problems on Mac minis.
https://github.com/AsahiLinux/m1n1/issues/159
'';
};
m1n1CustomLogo = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
Custom logo to build into m1n1. The path must point to a 256x256 PNG.
'';
};
};
}
}