aboutsummaryrefslogtreecommitdiff
path: root/infra/corenix/modules/tianocore/default.nix
blob: 59266c1aa05894f5696fa5c5a149826ab90135c3 (plain)
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
{ config, lib, pkgs, ... }:

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 = {
      ${payloadName} = {
        type = "payload";
        src = "${pkgs.coreboot-payload-tianocore}/FV/UEFIPAYLOAD.fd";
      };
    };
  };
}