2
0
Fork 0

nixos: add genode.init.verbose enable option

This commit is contained in:
Emery Hemingway 2020-11-10 15:46:24 +01:00
parent 6e37206cb3
commit cd5f6f84f8
1 changed files with 13 additions and 6 deletions

View File

@ -13,6 +13,8 @@ in {
options.genode.init = {
verbose = mkEnableOption "verbose logging";
configFile = mkOption {
description = ''
Dhall configuration of this init instance after children have been merged.
@ -92,15 +94,20 @@ in {
'';
}) cfg.subinits;
configFile = pkgs.writeText "init.dhall" ''
configFile = let
children =
lib.mapAttrsToList (name: value: ", `${name}` = ${value.configFile}")
cfg.children;
in pkgs.writeText "init.dhall" ''
let Genode = env:DHALL_GENODE
let baseConfig = ${cfg.baseConfig}
in baseConfig with children = baseConfig.children # toMap {${
concatMapStrings
(name: ", `${name}` = (${cfg.children.${name}.configFile}) ")
(builtins.attrNames cfg.children)
} }
in baseConfig // {
, verbose = ${if config.genode.init.verbose then "True" else "False"}
, children = baseConfig.children # toMap {${toString children} }
}
'';
};