aboutsummaryrefslogtreecommitdiff
path: root/modules/corenix/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/corenix/default.nix')
-rw-r--r--modules/corenix/default.nix38
1 files changed, 15 insertions, 23 deletions
diff --git a/modules/corenix/default.nix b/modules/corenix/default.nix
index d87a83ecaa45..0ab4e996ff2a 100644
--- a/modules/corenix/default.nix
+++ b/modules/corenix/default.nix
@@ -6,9 +6,7 @@ let
cfg = config.corenix;
fileOptions.options = {
- src = mkOption {
- type = types.nullOr types.path;
- };
+ src = mkOption { type = types.nullOr types.path; };
type = mkOption {
type = types.str;
@@ -17,17 +15,14 @@ let
};
in {
options.corenix = {
- installCommands = mkOption {
- type = types.lines;
- };
+ installCommands = mkOption { type = types.lines; };
- extraFiles = mkOption {
- type = types.attrsOf (types.submodule fileOptions);
- };
+ extraFiles =
+ mkOption { type = types.attrsOf (types.submodule fileOptions); };
corebootConfig = mkOption {
type = types.attrsOf (types.nullOr types.str);
- default = {};
+ default = { };
};
package = mkOption {
@@ -45,7 +40,7 @@ in {
corenix.installCommands = let
filteredFiles = filterAttrs (k: v: v.src != null) cfg.extraFiles;
filesList = mapAttrsToList (k: v: v // { name = k; }) filteredFiles;
- in concatMapStringsSep "\n" (file:
+ in concatMapStringsSep "\n" (file:
if file.type == "payload" then ''
cbfstool $out/coreboot.rom add-payload \
-f "${file.src}" \
@@ -55,18 +50,15 @@ in {
-f "${file.src}" \
-n "${file.name}" \
-t "${file.type}"
- ''
- ) filesList;
+ '') filesList;
- corenix.rom = let
- base = cfg.package.override {
- inherit (cfg) corebootConfig;
- };
- in pkgs.runCommand "coreboot-rom" {
- buildInputs = with pkgs; [ cbfstool ];
- } ''
- install -D ${base}/coreboot.rom -t $out
- ${cfg.installCommands}
- '';
+ corenix.rom =
+ let base = cfg.package.override { inherit (cfg) corebootConfig; };
+ in pkgs.runCommand "coreboot-rom" {
+ buildInputs = with pkgs; [ cbfstool ];
+ } ''
+ install -D ${base}/coreboot.rom -t $out
+ ${cfg.installCommands}
+ '';
};
}