From fb35449420dcc4d76397f0e6eee5fee73c5224bb Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Fri, 16 Apr 2021 13:19:59 +0200 Subject: [PATCH] nixos/gui: terminal is now a Gui client --- nixos-modules/gui/consoleLog.dhall | 73 ++++++------------------------ nixos-modules/gui/default.nix | 2 +- 2 files changed, 15 insertions(+), 60 deletions(-) diff --git a/nixos-modules/gui/consoleLog.dhall b/nixos-modules/gui/consoleLog.dhall index 2993291..e956856 100644 --- a/nixos-modules/gui/consoleLog.dhall +++ b/nixos-modules/gui/consoleLog.dhall @@ -14,12 +14,15 @@ let Resources = Init.Resources let ServiceRoute = Init.ServiceRoute +let routeLog = + λ(label : Text) → + ServiceRoute.childLabel "terminal_log" "LOG" (None Text) (Some label) + let routeRom = λ(label : Text) → ServiceRoute.parentLabel "ROM" (Some "log") (Some label) in λ ( params - : { gui_fb : Text - , fontFile : Text + : { fontFile : Text , log_core : Text , terminal : Text , terminal_log : Text @@ -30,33 +33,8 @@ in λ ( params Init.toChild Init::{ , routes = [ Init.ServiceRoute.parent "Timer" ] - , children = - [ { mapKey = "gui_fb" - , mapValue = - Child.flat - Child.Attributes::{ - , binary = params.gui_fb - , exitPropagate = True - , resources = Resources::{ ram = Sigil.units.MiB 8 } - , routes = [ Init.ServiceRoute.parent "Gui" ] - , config = Init.Config::{ - , attributes = toMap - { origin = "top_left", xpos = "0", ypos = "0" } - , policies = - [ Init.Config.Policy::{ - , service = "Framebuffer" - , label = Init.LabelSelector.prefix "terminal" - } - , Init.Config.Policy::{ - , service = "Input" - , label = Init.LabelSelector.prefix "terminal" - } - ] - } - } - } - , { mapKey = "terminal" - , mapValue = + , children = toMap + { terminal = Child.flat Child.Attributes::{ , binary = params.terminal @@ -66,8 +44,7 @@ in λ ( params , ram = Sigil.units.MiB 4 } , routes = - [ ServiceRoute.child "Framebuffer" "gui_fb" - , ServiceRoute.child "Input" "gui_fb" + [ ServiceRoute.parent "Gui" , ServiceRoute.parentLabel "ROM" (Some "vfs_ttf.lib.so") @@ -139,44 +116,22 @@ in λ ( params ] } } - } - , { mapKey = "terminal_log" - , mapValue = - Child.flat - Child.Attributes::{ - , binary = params.terminal_log - , config = Init.Config::{ - , policies = - [ Init.Config.Policy::{ - , service = "LOG" - , label = Init.LabelSelector.prefix "core_log" - } - , Init.Config.Policy::{ - , service = "LOG" - , label = Init.LabelSelector.prefix "kernel_log" - } - ] - } - } - } - , { mapKey = "core_log" - , mapValue = + , terminal_log = + Child.flat Child.Attributes::{ binary = params.terminal_log } + , core_log = Child.flat Child.Attributes::{ , binary = params.log_core , priorityOffset = 1 - , routes = [ routeRom "core_log" ] + , routes = [ routeLog "core", routeRom "core_log" ] } - } - , { mapKey = "kernel_log" - , mapValue = + , kernel_log = Child.flat Child.Attributes::{ , binary = params.log_core , priorityOffset = 1 - , routes = [ routeRom "kernel_log" ] + , routes = [ routeLog "kernel", routeRom "kernel_log" ] } } - ] } Init.Attributes.default diff --git a/nixos-modules/gui/default.nix b/nixos-modules/gui/default.nix index 33fb3c5..93c3964 100644 --- a/nixos-modules/gui/default.nix +++ b/nixos-modules/gui/default.nix @@ -98,7 +98,7 @@ in { genode.core.children.consoleLog = lib.mkIf cfg.consoleLog.enable (let erisInputs = (lib.attrsets.mapAttrs (_: lib.getEris "bin") { - inherit (pkgs.genodePackages) gui_fb log_core terminal terminal_log; + inherit (pkgs.genodePackages) log_core terminal terminal_log; }) // (lib.attrsets.mapAttrs (_: lib.getEris "lib") { inherit (pkgs.genodePackages) vfs_ttf; });