{ config, pkgs, lib, ... }: with lib; { imports = [ ./ahci.nix ./framebuffer.nix ./nic.nix ./usb.nix ]; options.hardware.genode.platform.policies = lib.mkOption { type = with types; listOf path; default = [ ]; description = '' List of policies to append to the Genode platform driver. Type is Init.Config.Policy.Type. ''; }; config = { genode.core.children.acpi_drv = { package = pkgs.genodePackages.acpi_drv; configFile = pkgs.writeText "acpi_drv.dhall" '' let Genode = env:DHALL_GENODE let Init = Genode.Init let label = λ(_ : Text) → { local = _, route = _ } in λ(binary : Text) → Init.Child.flat Init.Child.Attributes::{ , binary , resources = Init.Resources::{ , caps = 400 , ram = Genode.units.MiB 4 , constrainPhys = True } , romReports = [ label "acpi", label "smbios_table" ] , routes = [ Init.ServiceRoute.parent "IRQ" , Init.ServiceRoute.parent "IO_MEM" , Init.ServiceRoute.parent "IO_PORT" ] } ''; }; genode.core.children.platform_drv = { package = pkgs.genodePackages.platform_drv; configFile = let policies = map (policy: ", ${policy}") config.hardware.genode.platform.policies; in pkgs.writeText "platform_drv.dhall" '' let Genode = env:DHALL_GENODE let Init = Genode.Init in λ(binary : Text) -> Init.Child.flat Init.Child.Attributes::{ , binary , resources = Init.Resources::{ , caps = 800 , ram = Genode.units.MiB 4 , constrainPhys = True } , reportRoms = let label = "acpi" in [ { local = label, route = label } ] , provides = [ "Platform" ] , routes = [ Init.ServiceRoute.parent "IRQ" , Init.ServiceRoute.parent "IO_MEM" , Init.ServiceRoute.parent "IO_PORT" ] , config = Init.Config::{ , policies = [ ${toString policies} ] } } ''; }; }; }