aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Pässler <milan@petabyte.dev>2020-10-12 19:05:21 +0200
committerMilan Pässler <milan@petabyte.dev>2020-10-12 19:05:21 +0200
commitbd04e09fc6006d1ff048c6abdaa3e6ecef30fb4b (patch)
tree1aba3ab94f349b3159adff4edb25ef5e8e63bfda
parent949fa85bb8ad9c97c73e255a0f43247a41193e67 (diff)
allow tianocore as secondary payload
-rw-r--r--configs/milan-x1c.nix4
-rw-r--r--modules/tianocore/default.nix12
2 files changed, 14 insertions, 2 deletions
diff --git a/configs/milan-x1c.nix b/configs/milan-x1c.nix
index 41238461e287..2049e8086a2d 100644
--- a/configs/milan-x1c.nix
+++ b/configs/milan-x1c.nix
@@ -1,4 +1,4 @@
-{ ... }:
+{ lib, ... }:
{
imports = [
@@ -14,6 +14,8 @@
grub2.enable = true;
seabios.enable = true;
seabios.asSecondaryPayload = true;
+ tianocore.enable = true;
+ tianocore.asSecondaryPayload = true;
coreinfo.enable = true;
nvramcui.enable = true;
tint.enable = true;
diff --git a/modules/tianocore/default.nix b/modules/tianocore/default.nix
index 1ebf3d93d945..0ebe453909bb 100644
--- a/modules/tianocore/default.nix
+++ b/modules/tianocore/default.nix
@@ -4,14 +4,24 @@ with lib;
let
cfg = config.tianocore;
+ payloadName = if cfg.asSecondaryPayload then
+ "img/tianocore"
+ else
+ "fallback/payload";
+
in {
options.tianocore = {
enable = mkEnableOption "tianocore coreboot primary payload";
+
+ asSecondaryPayload = mkOption {
+ type = types.bool;
+ default = false;
+ };
};
config = lib.mkIf cfg.enable {
corenix.extraFiles = {
- "fallback/payload" = {
+ ${payloadName} = {
type = "payload";
src = "${pkgs.coreboot-payload-tianocore}/FV/UEFIPAYLOAD.fd";
};