2
0
Fork 0

nixos: add genode.init.verbose enable option

This commit is contained in:
Ehmry - 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 = { options.genode.init = {
verbose = mkEnableOption "verbose logging";
configFile = mkOption { configFile = mkOption {
description = '' description = ''
Dhall configuration of this init instance after children have been merged. Dhall configuration of this init instance after children have been merged.
@ -92,15 +94,20 @@ in {
''; '';
}) cfg.subinits; }) 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 Genode = env:DHALL_GENODE
let baseConfig = ${cfg.baseConfig} let baseConfig = ${cfg.baseConfig}
in baseConfig with children = baseConfig.children # toMap {${ in baseConfig // {
concatMapStrings , verbose = ${if config.genode.init.verbose then "True" else "False"}
(name: ", `${name}` = (${cfg.children.${name}.configFile}) ") , children = baseConfig.children # toMap {${toString children} }
(builtins.attrNames cfg.children) }
} }
''; '';
}; };