diff options
Diffstat (limited to 'infra/corenix/modules/coreinfo/default.nix')
-rw-r--r-- | infra/corenix/modules/coreinfo/default.nix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/infra/corenix/modules/coreinfo/default.nix b/infra/corenix/modules/coreinfo/default.nix new file mode 100644 index 000000000000..d1a2a19ecf34 --- /dev/null +++ b/infra/corenix/modules/coreinfo/default.nix @@ -0,0 +1,28 @@ +{ 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"; + }; + }; + }; +} |