diff --git a/nixos-modules/genode-init.nix b/nixos-modules/genode-init.nix index 6ba5ea5..1dd7889 100644 --- a/nixos-modules/genode-init.nix +++ b/nixos-modules/genode-init.nix @@ -31,6 +31,7 @@ in { in Sigil.Init::{ , routes = [ Sigil.Init.ServiceRoute.parent "File_system" + , Sigil.Init.ServiceRoute.parent "Gui" , Sigil.Init.ServiceRoute.parent "IO_MEM" , Sigil.Init.ServiceRoute.parent "IO_PORT" , Sigil.Init.ServiceRoute.parent "IRQ" diff --git a/nixos-modules/gui/consoleLog.dhall b/nixos-modules/gui/consoleLog.dhall index e956856..96162b5 100644 --- a/nixos-modules/gui/consoleLog.dhall +++ b/nixos-modules/gui/consoleLog.dhall @@ -14,10 +14,6 @@ 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) @@ -117,21 +113,51 @@ in λ ( params } } , terminal_log = - Child.flat Child.Attributes::{ binary = params.terminal_log } + Child.flat + Child.Attributes::{ + , binary = params.terminal_log + , config = Init.Config::{ + , content = + [ XML.leaf + { name = "initial" + , attributes = toMap + { width = "600" + , height = "400" + , info = "defaults to 1x1" + } + } + ] + , policies = + [ Init.Config.Policy::{ + , service = "LOG" + , label = Init.LabelSelector.prefix "core_log -> log" + , attributes = toMap { log_label = "[core] " } + } + , Init.Config.Policy::{ + , service = "LOG" + , label = Init.LabelSelector.prefix "kernel_log -> log" + , attributes = toMap { log_label = "[kernel] " } + } + ] + } + } , core_log = Child.flat Child.Attributes::{ , binary = params.log_core , priorityOffset = 1 - , routes = [ routeLog "core", routeRom "core_log" ] + , routes = [ routeRom "core_log" ] } , kernel_log = Child.flat Child.Attributes::{ , binary = params.log_core , priorityOffset = 1 - , routes = [ routeLog "kernel", routeRom "kernel_log" ] + , routes = [ routeRom "kernel_log" ] } } } - Init.Attributes.default + Init.Attributes::{ + , binary + , routes = [ Init.ServiceRoute.child "Gui" "gui" ] + } diff --git a/nixos-modules/gui/default.nix b/nixos-modules/gui/default.nix index 93c3964..58a29b7 100644 --- a/nixos-modules/gui/default.nix +++ b/nixos-modules/gui/default.nix @@ -73,21 +73,28 @@ in { genode.gui.domains.consoleLog = lib.mkIf cfg.consoleLog.enable { layer = toString cfg.consoleLog.layer; - label = "no"; content = "client"; }; hardware.genode.framebuffer.enable = cfg.enable; - genode.core.children.nitpicker = lib.mkIf cfg.enable (let - nitpicker' = lib.getEris' "bin" pkgs.genodePackages.nitpicker "nitpicker"; + genode.core.children.gui = lib.mkIf cfg.enable (let + eris = with pkgs.genodePackages; + lib.attrsets.mapAttrs (_: lib.getEris "bin") { + inherit decorator window_layouter wm; + } // (let nitpick = lib.getEris' "bin" nitpicker; + in { + nitpicker = nitpick "nitpicker"; + pointer = nitpick "pointer"; + }); in { - binary = nitpicker'.cap; - extraErisInputs = [ nitpicker' ]; - configFile = pkgs.writeText "nitpicker.dhall" '' - ${./nitpicker.dhall} {domains = ${toDhall domains'}, policies = [ ${ - lib.strings.concatStringsSep ", " cfg.policies - } ] } + package = pkgs.genodePackages.init; + extraErisInputs = builtins.attrValues eris; + configFile = pkgs.writeText "gui.dhall" '' + ${./gui.dhall} ${ + toDhall + (lib.attrsets.mapAttrs (_: value: { binary = value.cap; }) eris) + } ''; }); diff --git a/nixos-modules/gui/gui.dhall b/nixos-modules/gui/gui.dhall index 9c99707..484bdb8 100644 --- a/nixos-modules/gui/gui.dhall +++ b/nixos-modules/gui/gui.dhall @@ -10,7 +10,7 @@ let XML = Prelude.XML let Init = Sigil.Init -let forward = λ(x : Text) → { local = x, route = x } +let forward = λ(x : Text) → { report = x, rom = x } let Domain/Type = { name : Text, layer : Natural, attrs : Attributes } @@ -37,7 +37,7 @@ let nitpickerDomains = { content = "client" , label = "no" , focus = "click" - , hover = "transient" + , hover = "always" } } , { name = "other", layer = 2, attrs = toMap { content = "client" } } @@ -60,7 +60,7 @@ let BinaryField = { binary : Text } in λ ( params : { decorator : BinaryField - , layouter : BinaryField + , window_layouter : BinaryField , nitpicker : BinaryField , pointer : BinaryField , wm : BinaryField @@ -77,7 +77,6 @@ in λ ( params , binary = params.nitpicker.binary , resources = Init.Resources::{ ram = Sigil.units.MiB 4 } , config = Init.Config::{ - , attributes = toMap { focus = "rom" } , content = [ XML.leaf { name = "capture" @@ -94,6 +93,8 @@ in λ ( params , focus = "yes" , clicked = "yes" , keystate = "no" + , displays = "yes" + , pointer = "yes" } } , XML.leaf @@ -133,12 +134,19 @@ in λ ( params ] } , provides = [ "Capture", "Event" ] + , consumeReports = + [ { rom = "focus", report = "sculpt-only?" } ] , produceReports = let f = λ(report : Text) → - { report, rom = "nitpicker_" ++ local } + { report, rom = "nitpicker_" ++ report } - in [ f "hover", f "clicked", f "focus" ] + in [ f "hover" + , f "clicked" + , f "focus" + , f "displays" + , f "pointer" + ] } , pointer = Init.Child.flat @@ -148,7 +156,10 @@ in λ ( params , attributes = toMap { shape = "yes" } } , provides = [ "Report" ] - , reportRoms = [ forward "hover", forward "xray" ] + , consumeReports = + [ { rom = "hover", report = "nitpicker_hover" } + , forward "xray" + ] , resources = Init.Resources::{ ram = Sigil.units.MiB 2 } } , decorator = @@ -182,7 +193,7 @@ in λ ( params , layouter = Init.Child.flat Init.Child.Attributes::{ - , binary = params.layouter.binary + , binary = params.window_layouter.binary , resources = Init.Resources::{ ram = Sigil.units.MiB 4 } , consumeReports = [ forward "decorator_margins" @@ -191,11 +202,11 @@ in λ ( params , { rom = "rules", report = "layouter_rules" } , forward "window_list" ] - , procdueReports = + , produceReports = [ forward "window_layout" , forward "resize_request" , { report = "focus", rom = "layouter_focus" } - , { repot = "rules", rom = "layouter_rules" } + , { report = "rules", rom = "layouter_rules" } ] } , wm = @@ -233,10 +244,13 @@ in λ ( params } } } + , routes = [ Init.ServiceRoute.parent "Timer" ] , services = - [ Init.ServiceRoute.child "Gui" "wm" - , Init.ServiceRoute.child "Report" "wm" + [ Init.ServiceRoute.child "Capture" "nitpicker" + , Init.ServiceRoute.child "Event" "nitpicker" + , Init.ServiceRoute.child "Gui" "wm" , Init.ServiceRoute.child "ROM" "wm" + , Init.ServiceRoute.child "Report" "wm" ] } - Init.Attributes::{ binary } + Init.Attributes::{ provides = [ "Capture", "Event", "Gui" ] } diff --git a/nixos-modules/hardware/framebuffer.nix b/nixos-modules/hardware/framebuffer.nix index a789c7c..d136dd5 100644 --- a/nixos-modules/hardware/framebuffer.nix +++ b/nixos-modules/hardware/framebuffer.nix @@ -46,6 +46,7 @@ in { , routes = [ Init.ServiceRoute.parent "IO_MEM" , Init.ServiceRoute.parent "IO_PORT" + , Init.ServiceRoute.child "Capture" "gui" ] } ''; diff --git a/nixos-modules/store-wrapper.dhall b/nixos-modules/store-wrapper.dhall index 1d3ea7d..6a3b592 100644 --- a/nixos-modules/store-wrapper.dhall +++ b/nixos-modules/store-wrapper.dhall @@ -108,6 +108,7 @@ in λ ( params , Init.ServiceRoute.parent "VM" , Init.ServiceRoute.child "Timer" "timer" , Init.ServiceRoute.child "Rtc" "rtc" + , Init.ServiceRoute.child "Gui" "gui" ] } )