aboutsummaryrefslogtreecommitdiff
path: root/modules/coreinfo/default.nix
blob: 775bb11cb56ef0fd9f4023623d1463e7b4d1ca73 (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
{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.coreinfo;
in {
  options.coreinfo = {
    enable = mkEnableOption "coreinfo coreboot secondary payload";

    coreinfoConfig = mkOption {
      type = types.attrsOf (types.nullOr types.str);
      default = {};
    };
  };

  config = lib.mkIf cfg.enable {
    corenix.extraFiles = {
      "img/coreinfo" = {
        type = "payload";
        src = "${pkgs.coreboot-payload-coreinfo.override {
          inherit (cfg) coreinfoConfig;
        }}/coreinfo.elf";
      };
    };
  };
}