aboutsummaryrefslogtreecommitdiff
path: root/modules/tianocore/default.nix
blob: 0ebe453909bba3deffb002188e492a79f2ec9d20 (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
29
30
{ 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";
      };
    };
  };
}