Rename dhall-genode to dhall-sigil

This commit is contained in:
Ehmry - 2021-03-28 15:07:21 +02:00
parent 88668e8dd5
commit 94c73172cb
35 changed files with 202 additions and 207 deletions

View File

@ -1,11 +1,11 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Prelude = Genode.Prelude let Prelude = Sigil.Prelude
let XML = Prelude.XML let XML = Prelude.XML
let Init = Genode.Init let Init = Sigil.Init
let Child = Init.Child let Child = Init.Child
@ -69,7 +69,7 @@ let drivers =
, priority = 1 , priority = 1
, resources = Resources::{ , resources = Resources::{
, caps = 350 , caps = 350
, ram = Genode.units.MiB 4 , ram = Sigil.units.MiB 4
} }
, romReports = [ label "acpi" ] , romReports = [ label "acpi" ]
, routes = , routes =
@ -86,7 +86,7 @@ let drivers =
, binary = "platform_drv" , binary = "platform_drv"
, resources = Resources::{ , resources = Resources::{
, caps = 400 , caps = 400
, ram = Genode.units.MiB 4 , ram = Sigil.units.MiB 4
, constrainPhys = True , constrainPhys = True
} }
, provides = [ "Acpi", "Platform" ] , provides = [ "Acpi", "Platform" ]
@ -149,7 +149,7 @@ let drivers =
, priority = 1 , priority = 1
, resources = Resources::{ , resources = Resources::{
, caps = 200 , caps = 200
, ram = Genode.units.MiB 16 , ram = Sigil.units.MiB 16
} }
, provides = [ "Input", "Usb" ] , provides = [ "Input", "Usb" ]
, reportRoms = [ relabel "config" "usb_drv.config" ] , reportRoms = [ relabel "config" "usb_drv.config" ]
@ -174,7 +174,7 @@ let drivers =
Child.Attributes::{ Child.Attributes::{
, binary = "event_filter" , binary = "event_filter"
, priority = 1 , priority = 1
, resources = Resources::{ ram = Genode.units.MiB 2 } , resources = Resources::{ ram = Sigil.units.MiB 2 }
, provides = [ "Input" ] , provides = [ "Input" ]
, routes = , routes =
[ ServiceRoute.parentLabel [ ServiceRoute.parentLabel
@ -226,7 +226,7 @@ let drivers =
, priority = 1 , priority = 1
, resources = Resources::{ , resources = Resources::{
, caps = 1400 , caps = 1400
, ram = Genode.units.MiB 64 , ram = Sigil.units.MiB 64
} }
, provides = [ "Framebuffer", "Block" ] , provides = [ "Framebuffer", "Block" ]
, romReports = [ label "ahci_ports", label "nvme_ns" ] , romReports = [ label "ahci_ports", label "nvme_ns" ]

View File

@ -1,15 +1,15 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Prelude = Genode.Prelude let Prelude = Sigil.Prelude
let BootModules = Genode.BootModules let BootModules = Sigil.BootModules
let RomEntry = Prelude.Map.Entry Text BootModules.ROM.Type let RomEntry = Prelude.Map.Entry Text BootModules.ROM.Type
let compile = let compile =
λ(addressType : Text) λ(addressType : Text)
→ λ(boot : Genode.Boot.Type) → λ(boot : Sigil.Boot.Type)
→ λ(out : Text) → λ(out : Text)
→ let NaturalIndex = { index : Natural, value : Text } → let NaturalIndex = { index : Natural, value : Text }
@ -111,10 +111,10 @@ let compile =
_boot_modules_binaries_end: _boot_modules_binaries_end:
'' ''
in { config = Genode.Init.render boot.config in { config = Sigil.Init.render boot.config
, modules_asm = asm , modules_asm = asm
, stats = , stats =
let sum = Genode.Init.resources boot.config let sum = Sigil.Init.resources boot.config
in "RAM=${Prelude.Natural.show sum.ram}" in "RAM=${Prelude.Natural.show sum.ram}"
} }

View File

@ -3,13 +3,13 @@
let let
inherit (pkgs) buildPackages; inherit (pkgs) buildPackages;
localPackages = pkgs.buildPackages.buildPackages; localPackages = pkgs.buildPackages.buildPackages;
inherit (pkgs.genodePackages) dhallGenode genodeSources; inherit (pkgs.genodePackages) dhallSigil genodeSources;
dhallCachePrelude = '' dhallCachePrelude = ''
export XDG_CACHE_HOME=$NIX_BUILD_TOP export XDG_CACHE_HOME=$NIX_BUILD_TOP
export DHALL_GENODE="${dhallGenode}/binary.dhall"; export DHALL_SIGIL="${dhallSigil}/binary.dhall";
${buildPackages.xorg.lndir}/bin/lndir -silent \ ${buildPackages.xorg.lndir}/bin/lndir -silent \
${dhallGenode}/.cache \ ${dhallSigil}/.cache \
$XDG_CACHE_HOME $XDG_CACHE_HOME
''; '';
@ -50,11 +50,11 @@ in rec {
bootstrapDhall = bootstrapDhall =
# snippet used to nest core.elf into image.elf # snippet used to nest core.elf into image.elf
builtins.toFile "boostrap.dall" '' builtins.toFile "boostrap.dall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
in { config = Genode.Init.default in { config = Sigil.Init.default
, rom = , rom =
Genode.BootModules.toRomPaths Sigil.BootModules.toRomPaths
[ { mapKey = "core.elf", mapValue = "./core.elf" } ] [ { mapKey = "core.elf", mapValue = "./core.elf" } ]
} }
''; '';

View File

@ -1,11 +1,11 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Prelude = Genode.Prelude let Prelude = Sigil.Prelude
let Args = { config : Genode.Init.Type, rom : Genode.BootModules.Type } : Type let Args = { config : Sigil.Init.Type, rom : Sigil.BootModules.Type } : Type
let RomEntry = Prelude.Map.Entry Text Genode.BootModules.ROM.Type let RomEntry = Prelude.Map.Entry Text Sigil.BootModules.ROM.Type
let addLine = let addLine =
λ(e : RomEntry) λ(e : RomEntry)
@ -28,7 +28,7 @@ let addLine =
in λ(args : Args) in λ(args : Args)
→ λ(out : Text) → λ(out : Text)
→ { config = Genode.Init.render args.config → { config = Sigil.Init.render args.config
, script = , script =
Prelude.List.fold Prelude.List.fold
RomEntry RomEntry

View File

@ -11,9 +11,9 @@ let
nativeBuildInputs = [ dhall-json ]; nativeBuildInputs = [ dhall-json ];
} '' } ''
dhall-to-json << EOF > $out dhall-to-json << EOF > $out
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let init = ${initConfig} let init = ${initConfig}
in Genode.Init.Child.binaries (Genode.Init.toChild init Genode.Init.Attributes::{=}) in Sigil.Init.Child.binaries (Sigil.Init.toChild init Sigil.Init.Attributes::{=})
EOF EOF
''; '';
binariesJSON = readFile (toString extractDrv); binariesJSON = readFile (toString extractDrv);
@ -52,9 +52,9 @@ let
lib.mapAttrsToList (name: value: { inherit name value; }) extraRoms; lib.mapAttrsToList (name: value: { inherit name value; }) extraRoms;
in writeText "boot.dhall" '' in writeText "boot.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
in { config = ${initConfig} in { config = ${initConfig}
, rom = Genode.BootModules.toRomPaths ([ , rom = Sigil.BootModules.toRomPaths ([
${ ${
toString (map ({ name, value }: '' toString (map ({ name, value }: ''
, { mapKey = "${name}", mapValue = "${value}" } , { mapKey = "${name}", mapValue = "${value}" }

View File

@ -1,6 +1,6 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Genode.Init let Init = Sigil.Init
let Child = Init.Child let Child = Init.Child
@ -8,9 +8,9 @@ in λ(binary : Text) →
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary , binary
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 32 , ram = Sigil.units.MiB 32
} }
, config = Init.Config::{ , config = Init.Config::{
, policies = , policies =

View File

@ -9,13 +9,13 @@
package = pkgs.genodePackages.vfs; package = pkgs.genodePackages.vfs;
extraErisInputs = [ vfsRump ]; extraErisInputs = [ vfsRump ];
configFile = pkgs.writeText "rom-vfs.dhall" '' configFile = pkgs.writeText "rom-vfs.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let VFS = Genode.VFS let VFS = Sigil.VFS
in ${./rom-vfs.dhall} in ${./rom-vfs.dhall}
${../partition-type} ${../partition-type}
Genode.Init.Resources::{ caps = 256, ram = Genode.units.MiB 16 } Sigil.Init.Resources::{ caps = 256, ram = Sigil.units.MiB 16 }
( VFS.vfs ( VFS.vfs
[ VFS.leafAttrs [ VFS.leafAttrs
"plugin" "plugin"

View File

@ -7,12 +7,12 @@
genode.core.children.eris_vfs = { genode.core.children.eris_vfs = {
package = pkgs.genodePackages.vfs; package = pkgs.genodePackages.vfs;
configFile = pkgs.writeText "rom-vfs.dhall" '' configFile = pkgs.writeText "rom-vfs.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let VFS = Genode.VFS let VFS = Sigil.VFS
in ${./rom-vfs.dhall} in ${./rom-vfs.dhall}
Genode.Init.Resources::{=} Sigil.Init.Resources::{=}
( VFS.vfs ( VFS.vfs
[ VFS.leafAttrs [ VFS.leafAttrs
"tar" "tar"

View File

@ -1,12 +1,12 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Genode.Init let Init = Sigil.Init
let Child = Init.Child let Child = Init.Child
in λ(partitionType : Text) → in λ(partitionType : Text) →
λ(resources : Init.Resources.Type) → λ(resources : Init.Resources.Type) →
λ(vfsConfig : Genode.Prelude.XML.Type) → λ(vfsConfig : Sigil.Prelude.XML.Type) →
λ(binary : Text) → λ(binary : Text) →
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{

View File

@ -88,10 +88,10 @@ let
{ service = { service =
{ name = "ROM" { name = "ROM"
, label = , label =
Genode.Init.LabelSelector.Type.Partial Sigil.Init.LabelSelector.Type.Partial
{ prefix = Some "nixos -> ${name}", suffix = Some "${suffix}" } { prefix = Some "nixos -> ${name}", suffix = Some "${suffix}" }
} }
, route = Genode.Init.Route.parent (Some "${suffix}") , route = Sigil.Init.Route.parent (Some "${suffix}")
} }
'') value.coreROMs) config.genode.init.children)); '') value.coreROMs) config.genode.init.children));
@ -104,16 +104,16 @@ let
in with coreErisCaps; in with coreErisCaps;
localPackages.runCommand "boot.dhall" { } '' localPackages.runCommand "boot.dhall" { } ''
cat > $out << EOF cat > $out << EOF
let Genode = env:DHALL_GENODE in let Sigil = env:DHALL_SIGIL in
let VFS = Genode.VFS let VFS = Sigil.VFS
let XML = Genode.Prelude.XML let XML = Sigil.Prelude.XML
in in
${./store-wrapper.dhall} ${./store-wrapper.dhall}
{ binaries = { rtc_drv = "${rtc_drv.cap}" } { binaries = { rtc_drv = "${rtc_drv.cap}" }
, extraCoreChildren = ${extraCoreChildren} , extraCoreChildren = ${extraCoreChildren}
, subinit = ${config.genode.init.configFile} , subinit = ${config.genode.init.configFile}
, storeSize = $(stat --format '%s' ${tarball}) , storeSize = $(stat --format '%s' ${tarball})
, routes = [${extraRoutes} ] : List Genode.Init.ServiceRoute.Type , routes = [${extraRoutes} ] : List Sigil.Init.ServiceRoute.Type
, bootManifest = ${manifest} , bootManifest = ${manifest}
} }
EOF EOF
@ -149,7 +149,7 @@ in {
Set of children at the lowest init level, these children must not Set of children at the lowest init level, these children must not
have any dependency on a Nix store. have any dependency on a Nix store.
Configuration format is a Dhall configuration of type Configuration format is a Dhall configuration of type
<literal>Genode.Init.Child.Type</literal>. <literal>Sigil.Init.Child.Type</literal>.
See https://git.sr.ht/~ehmry/dhall-genode/tree/master/Init/Child/Type See https://git.sr.ht/~ehmry/dhall-genode/tree/master/Init/Child/Type
''; '';
}; };
@ -260,9 +260,9 @@ in {
genode.core.children.jitter_sponge = { genode.core.children.jitter_sponge = {
package = pkgs.genodePackages.jitter_sponge; package = pkgs.genodePackages.jitter_sponge;
configFile = pkgs.writeText "jitter_sponge.dhall" '' configFile = pkgs.writeText "jitter_sponge.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Genode.Init let Init = Sigil.Init
in λ(binary : Text) in λ(binary : Text)
Init.Child.flat Init.Child.flat
@ -294,13 +294,13 @@ in {
system.build.initXml = pkgs.buildPackages.runCommand "init.xml" { system.build.initXml = pkgs.buildPackages.runCommand "init.xml" {
nativeBuildInputs = with pkgs.buildPackages; [ dhall xorg.lndir libxml2 ]; nativeBuildInputs = with pkgs.buildPackages; [ dhall xorg.lndir libxml2 ];
DHALL_GENODE = "${pkgs.genodePackages.dhallGenode}/binary.dhall"; DHALL_SIGIL = "${pkgs.genodePackages.dhallSigil}/binary.dhall";
} '' } ''
export XDG_CACHE_HOME=$NIX_BUILD_TOP export XDG_CACHE_HOME=$NIX_BUILD_TOP
lndir -silent \ lndir -silent \
${pkgs.genodePackages.dhallGenode}/.cache \ ${pkgs.genodePackages.dhallSigil}/.cache \
$XDG_CACHE_HOME $XDG_CACHE_HOME
dhall text <<< "(env:DHALL_GENODE).Init.render (${bootConfigFile}).config" > $out dhall text <<< "(env:DHALL_SIGIL).Init.render (${bootConfigFile}).config" > $out
xmllint --noout $out xmllint --noout $out
''; '';

View File

@ -25,17 +25,17 @@ in {
"Dhall configuration of this init instance before merging children."; "Dhall configuration of this init instance before merging children.";
type = types.str; type = types.str;
default = '' default = ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
in Genode.Init::{ in Sigil.Init::{
, routes = , routes =
[ Genode.Init.ServiceRoute.parent "File_system" [ Sigil.Init.ServiceRoute.parent "File_system"
, Genode.Init.ServiceRoute.parent "IO_MEM" , Sigil.Init.ServiceRoute.parent "IO_MEM"
, Genode.Init.ServiceRoute.parent "IO_PORT" , Sigil.Init.ServiceRoute.parent "IO_PORT"
, Genode.Init.ServiceRoute.parent "IRQ" , Sigil.Init.ServiceRoute.parent "IRQ"
, Genode.Init.ServiceRoute.parent "Rtc" , Sigil.Init.ServiceRoute.parent "Rtc"
, Genode.Init.ServiceRoute.parent "Terminal" , Sigil.Init.ServiceRoute.parent "Terminal"
, Genode.Init.ServiceRoute.parent "Timer" , Sigil.Init.ServiceRoute.parent "Timer"
] ]
} }
''; '';
@ -100,9 +100,9 @@ in {
children = mapAttrs (name: value: { children = mapAttrs (name: value: {
inherit (value) extraErisInputs extraInputs; inherit (value) extraErisInputs extraInputs;
configFile = pkgs.writeText "${name}.child.dhall" '' configFile = pkgs.writeText "${name}.child.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
in Genode.Init.toChild ${value.configFile} Genode.Init.Attributes.default in Sigil.Init.toChild ${value.configFile} Sigil.Init.Attributes.default
''; '';
}) cfg.subinits; }) cfg.subinits;
@ -116,14 +116,16 @@ in {
(map (label: '' (map (label: ''
, { service = , { service =
{ name = "Nic" { name = "Nic"
, label = Genode.Init.LabelSelector.prefix "${child}" , label = Sigil.Init.LabelSelector.prefix "${child}"
} }
, route = Genode.Init.Route.parent (None Text) , route = Sigil.Init.Route.parent (None Text)
} }
'') value.routeToNics)) config.genode.init.children; '') value.routeToNics)) config.genode.init.children;
in pkgs.writeText "init.dhall" '' in pkgs.writeText "init.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Sigil.Init
let baseConfig = ${cfg.baseConfig} let baseConfig = ${cfg.baseConfig}
@ -131,11 +133,11 @@ in {
, verbose = ${if config.genode.init.verbose then "True" else "False"} , verbose = ${if config.genode.init.verbose then "True" else "False"}
, children = baseConfig.children # ([ ${ , children = baseConfig.children # ([ ${
toString children toString children
} ] : Genode.Init.Children.Type) } ] : Init.Children.Type)
, routes = baseConfig.routes # ([${ , routes = baseConfig.routes # ([${
toString nicRoutes toString nicRoutes
}] : List Genode.Init.ServiceRoute.Type) }] : List Init.ServiceRoute.Type)
} : Genode.Init.Type } : Init.Type
''; '';
romModules = with builtins; romModules = with builtins;

View File

@ -1,12 +1,12 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Prelude = Genode.Prelude let Prelude = Sigil.Prelude
let VFS = Genode.VFS let VFS = Sigil.VFS
let XML = Prelude.XML let XML = Prelude.XML
let Init = Genode.Init let Init = Sigil.Init
let Child = Init.Child let Child = Init.Child
@ -30,7 +30,7 @@ in λ(params : { fontFile : Text }) →
Child.Attributes::{ Child.Attributes::{
, binary = "${pkgs.genodePackages.gui_fb}/bin/gui_fb" , binary = "${pkgs.genodePackages.gui_fb}/bin/gui_fb"
, exitPropagate = True , exitPropagate = True
, resources = Resources::{ ram = Genode.units.MiB 8 } , resources = Resources::{ ram = Sigil.units.MiB 8 }
, config = Init.Config::{ , config = Init.Config::{
, attributes = toMap , attributes = toMap
{ origin = "top_right" { origin = "top_right"
@ -58,7 +58,7 @@ in λ(params : { fontFile : Text }) →
, exitPropagate = True , exitPropagate = True
, resources = Resources::{ , resources = Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 4 , ram = Sigil.units.MiB 4
} }
, routes = , routes =
[ ServiceRoute.child "Framebuffer" "gui_fb" [ ServiceRoute.child "Framebuffer" "gui_fb"

View File

@ -18,7 +18,7 @@ in {
genode.core.children.nitpicker = mkIf cfg.enable { genode.core.children.nitpicker = mkIf cfg.enable {
binary = pkgs.genodePackages.nitpicker; binary = pkgs.genodePackages.nitpicker;
configFile = pkgs.writeText "nitpicker.dhall" '' configFile = pkgs.writeText "nitpicker.dhall" ''
let Init = (env:DHALL_GENODE).Init let Init = (env:DHALL_SIGIL).Init
in ${./nitpicker.dhall} in ${./nitpicker.dhall}
{ policies = { policies =

View File

@ -1,15 +1,15 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let XML = Genode.Prelude.XML let XML = Sigil.Prelude.XML
let Init = Genode.Init let Init = Sigil.Init
in λ(params : { policies : List Init.Config.Policy.Type }) → in λ(params : { policies : List Init.Config.Policy.Type }) →
λ(binary : Text) → λ(binary : Text) →
Init.Child.flat Init.Child.flat
Init.Child.Attributes::{ Init.Child.Attributes::{
, binary , binary
, resources = Init.Resources::{ ram = Genode.units.MiB 4 } , resources = Init.Resources::{ ram = Sigil.units.MiB 4 }
, config = Init.Config::{ , config = Init.Config::{
, attributes = toMap , attributes = toMap
{ note = "Nitpicker config is extremely fragile!" } { note = "Nitpicker config is extremely fragile!" }

View File

@ -13,13 +13,13 @@ with lib;
hardware.genode.platform.policies = lib.optional cfg.enable hardware.genode.platform.policies = lib.optional cfg.enable
(builtins.toFile ("ahci.platform-policy.dhall") '' (builtins.toFile ("ahci.platform-policy.dhall") ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
in Genode.Init.Config.Policy::{ in Sigil.Init.Config.Policy::{
, service = "Platform" , service = "Platform"
, label = Genode.Init.LabelSelector.prefix "drivers -> ahci" , label = Sigil.Init.LabelSelector.prefix "drivers -> ahci"
, content = , content =
[ Genode.Prelude.XML.leaf [ Sigil.Prelude.XML.leaf
{ name = "pci", attributes = toMap { class = "AHCI" } } { name = "pci", attributes = toMap { class = "AHCI" } }
] ]
} }

View File

@ -19,7 +19,7 @@ with lib;
partBlockEris = lib.getEris "bin" pkgs.genodePackages.part_block; partBlockEris = lib.getEris "bin" pkgs.genodePackages.part_block;
usbEris = lib.attrsets.mapAttrs (_: lib.getEris "bin") { usbEris = lib.attrsets.mapAttrs (_: lib.getEris "bin") {
inherit (pkgs.genodePackages) usb_block_drv usb_drv; inherit (pkgs.genodePackages) usb_block_drv usb_drv;
}; };
ahciConfig = with config.hardware.genode.ahci; ahciConfig = with config.hardware.genode.ahci;
@ -62,9 +62,9 @@ with lib;
genode.core.children.acpi_drv = { genode.core.children.acpi_drv = {
package = pkgs.genodePackages.acpi_drv; package = pkgs.genodePackages.acpi_drv;
configFile = pkgs.writeText "acpi_drv.dhall" '' configFile = pkgs.writeText "acpi_drv.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Genode.Init let Init = Sigil.Init
let label = λ(_ : Text) { local = _, route = _ } let label = λ(_ : Text) { local = _, route = _ }
@ -74,7 +74,7 @@ with lib;
, binary , binary
, resources = Init.Resources::{ , resources = Init.Resources::{
, caps = 400 , caps = 400
, ram = Genode.units.MiB 4 , ram = Sigil.units.MiB 4
, constrainPhys = True , constrainPhys = True
} }
, romReports = [ label "acpi", label "smbios_table" ] , romReports = [ label "acpi", label "smbios_table" ]
@ -93,16 +93,16 @@ with lib;
policies = policies =
map (policy: ", ${policy}") config.hardware.genode.platform.policies; map (policy: ", ${policy}") config.hardware.genode.platform.policies;
in pkgs.writeText "platform_drv.dhall" '' in pkgs.writeText "platform_drv.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Genode.Init let Init = Sigil.Init
in λ(binary : Text) -> Init.Child.flat in λ(binary : Text) -> Init.Child.flat
Init.Child.Attributes::{ Init.Child.Attributes::{
, binary , binary
, resources = Init.Resources::{ , resources = Init.Resources::{
, caps = 800 , caps = 800
, ram = Genode.units.MiB 4 , ram = Sigil.units.MiB 4
, constrainPhys = True , constrainPhys = True
} }
, reportRoms = let label = "acpi" in [ { local = label, route = label } ] , reportRoms = let label = "acpi" in [ { local = label, route = label } ]
@ -124,15 +124,15 @@ with lib;
genode.core.children.device_manager = { genode.core.children.device_manager = {
package = pkgs.genodePackages.device_manager; package = pkgs.genodePackages.device_manager;
configFile = pkgs.writeText "device_manager.dhall" '' configFile = pkgs.writeText "device_manager.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
in λ(cap : Text) in λ(cap : Text)
Genode.Init.Child.flat Sigil.Init.Child.flat
( (${managerConfig}).device_manager ( (${managerConfig}).device_manager
{ binary = cap { binary = cap
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 8 , ram = Sigil.units.MiB 8
} }
} }
) )
@ -141,24 +141,24 @@ with lib;
genode.core.children.drivers = { genode.core.children.drivers = {
package = pkgs.genodePackages.init; package = pkgs.genodePackages.init;
extraErisInputs = [ partBlockEris ] ++ extraErisInputs = [ partBlockEris ]
lib.optional config.hardware.genode.ahci.enable ahciEris ++ lib.optional config.hardware.genode.ahci.enable ahciEris
++ lib.optionals config.hardware.genode.usb.enable ++ lib.optionals config.hardware.genode.usb.enable
(builtins.attrValues usbEris); (builtins.attrValues usbEris);
configFile = pkgs.writeText "drivers.dhall" '' configFile = pkgs.writeText "drivers.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let childAttrs = (${managerConfig}).drivers let childAttrs = (${managerConfig}).drivers
in λ(cap : Text) in λ(cap : Text)
Genode.Init.Child.flat Sigil.Init.Child.flat
( childAttrs ( childAttrs
{ binary = cap { binary = cap
, config = , config =
childAttrs.config childAttrs.config
with policies = with policies =
[ Genode.Init.Config.Policy::{ [ Sigil.Init.Config.Policy::{
, label = Genode.Init.LabelSelector.none , label = Sigil.Init.LabelSelector.none
, service = "Block" , service = "Block"
} }
] ]

View File

@ -22,15 +22,15 @@ with lib;
vesa = vesa_drv; vesa = vesa_drv;
}.${config.hardware.genode.framebuffer.driver}; }.${config.hardware.genode.framebuffer.driver};
in builtins.toFile "fb_drv.dhall" '' in builtins.toFile "fb_drv.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Genode.Init let Init = Sigil.Init
in λ(binary : Text) in λ(binary : Text)
Init.Child.flat Init.Child.flat
Init.Child.Attributes::{ Init.Child.Attributes::{
, binary , binary
, resources = Init.Resources::{ caps = 256, ram = Genode.units.MiB 32 } , resources = Init.Resources::{ caps = 256, ram = Sigil.units.MiB 32 }
, routes = , routes =
[ Init.ServiceRoute.parent "IO_MEM" [ Init.ServiceRoute.parent "IO_MEM"
, Init.ServiceRoute.parent "IO_PORT" , Init.ServiceRoute.parent "IO_PORT"

View File

@ -30,15 +30,15 @@ with lib;
virtio = virtio_nic_drv; virtio = virtio_nic_drv;
}.${driver}; }.${driver};
configFile = pkgs.writeText "${name}.dhall" '' configFile = pkgs.writeText "${name}.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Genode.Init let Init = Sigil.Init
in λ(binary : Text) in λ(binary : Text)
Init.Child.flat Init.Child.flat
Init.Child.Attributes::{ Init.Child.Attributes::{
, binary , binary
, resources = Init.Resources::{ caps = 128, ram = Genode.units.MiB 4 } , resources = Init.Resources::{ caps = 128, ram = Sigil.units.MiB 4 }
, routes = [ Init.ServiceRoute.parent "IO_MEM" ] , routes = [ Init.ServiceRoute.parent "IO_MEM" ]
, config = Init.Config::{ , config = Init.Config::{
, attributes = toMap { verbose = "${ , attributes = toMap { verbose = "${
@ -58,15 +58,15 @@ with lib;
mkUplinkDump = { name, childName, policyPrefix }: { mkUplinkDump = { name, childName, policyPrefix }: {
package = pkgs.genodePackages.nic_dump; package = pkgs.genodePackages.nic_dump;
configFile = pkgs.writeText "${name}.dhall" '' configFile = pkgs.writeText "${name}.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Genode.Init let Init = Sigil.Init
in λ(binary : Text) in λ(binary : Text)
Init.Child.flat Init.Child.flat
Init.Child.Attributes::{ Init.Child.Attributes::{
, binary , binary
, resources = Init.Resources::{ caps = 128, ram = Genode.units.MiB 6 } , resources = Init.Resources::{ caps = 128, ram = Sigil.units.MiB 6 }
, config = Init.Config::{ , config = Init.Config::{
, attributes = toMap { downlink = "${childName}", uplink = "driver" } , attributes = toMap { downlink = "${childName}", uplink = "driver" }
, policies = , policies =

View File

@ -52,13 +52,13 @@ with lib;
hardware.genode.platform.policies = lib.optional cfg.enable hardware.genode.platform.policies = lib.optional cfg.enable
(builtins.toFile ("usb.platform-policy.dhall") '' (builtins.toFile ("usb.platform-policy.dhall") ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
in Genode.Init.Config.Policy::{ in Sigil.Init.Config.Policy::{
, service = "Platform" , service = "Platform"
, label = Genode.Init.LabelSelector.prefix "drivers -> usb" , label = Sigil.Init.LabelSelector.prefix "drivers -> usb"
, content = , content =
[ Genode.Prelude.XML.leaf [ Sigil.Prelude.XML.leaf
{ name = "pci", attributes = toMap { class = "USB" } } { name = "pci", attributes = toMap { class = "USB" } }
] ]
} }

View File

@ -11,14 +11,14 @@ mkOption {
platformPolicy = mkOption { platformPolicy = mkOption {
type = types.path; type = types.path;
default = builtins.toFile "driver.policy.dhall" '' default = builtins.toFile "driver.policy.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
in λ(driverName : Text) in λ(driverName : Text)
Genode.Init.Config.Policy::{ Sigil.Init.Config.Policy::{
, service = "Platform" , service = "Platform"
, label = Genode.Init.LabelSelector.prefix driverName , label = Sigil.Init.LabelSelector.prefix driverName
, content = , content =
[ Genode.Prelude.XML.leaf [ Sigil.Prelude.XML.leaf
{ name = "pci", attributes = toMap { class = "ETHERNET" } } { name = "pci", attributes = toMap { class = "ETHERNET" } }
] ]
} }

View File

@ -1,8 +1,8 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Prelude = Genode.Prelude let Prelude = Sigil.Prelude
let Init = Genode.Init let Init = Sigil.Init
let Child = Init.Child let Child = Init.Child
@ -21,7 +21,7 @@ in λ ( params
, bootManifest : Manifest/Type , bootManifest : Manifest/Type
} }
) → ) →
Genode.Boot::{ Sigil.Boot::{
, config = Init::{ , config = Init::{
, routes = params.routes , routes = params.routes
, children = , children =
@ -67,7 +67,7 @@ in λ ( params
Init.Attributes::{ Init.Attributes::{
, exitPropagate = True , exitPropagate = True
, resources = Init.Resources::{ , resources = Init.Resources::{
, ram = Genode.units.MiB 4 , ram = Sigil.units.MiB 4
} }
, routes = , routes =
let parentROMs = let parentROMs =
@ -113,7 +113,7 @@ in λ ( params
] ]
} }
, rom = , rom =
Genode.BootModules.toRomPaths Sigil.BootModules.toRomPaths
( Prelude.List.concat ( Prelude.List.concat
(Prelude.Map.Entry Text Text) (Prelude.Map.Entry Text Text)
( Prelude.Map.values ( Prelude.Map.values

View File

@ -1,14 +1,14 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Prelude = Genode.Prelude let Prelude = Sigil.Prelude
let XML = Prelude.XML let XML = Prelude.XML
let Libc = Genode.Libc let Libc = Sigil.Libc
let VFS = Genode.VFS let VFS = Sigil.VFS
let Init = Genode.Init let Init = Sigil.Init
let Child = Init.Child let Child = Init.Child
@ -48,9 +48,9 @@ in λ ( params
Child.Attributes::{ Child.Attributes::{
, binary = "vfs" , binary = "vfs"
, exitPropagate = True , exitPropagate = True
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 8 , ram = Sigil.units.MiB 8
} }
, config = Init.Config::{ , config = Init.Config::{
, content = , content =
@ -128,8 +128,8 @@ in λ ( params
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary = "cached_fs_rom" , binary = "cached_fs_rom"
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, ram = Genode.units.MiB 32 , ram = Sigil.units.MiB 32
} }
, config = Init.Config::{ , config = Init.Config::{
, policies = , policies =
@ -147,9 +147,9 @@ in λ ( params
Child.Attributes::{ Child.Attributes::{
, binary = params.binary , binary = params.binary
, exitPropagate = True , exitPropagate = True
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB params.ramQuotaMiB , ram = Sigil.units.MiB params.ramQuotaMiB
} }
, config = , config =
( Libc.toConfig ( Libc.toConfig

View File

@ -86,7 +86,7 @@ with lib; {
, coreutils = "${pkgs.coreutils}" , coreutils = "${pkgs.coreutils}"
, extraVfs = ${ , extraVfs = ${
if service.genode.extraVfs == null then if service.genode.extraVfs == null then
"[] : List (env:DHALL_GENODE).Prelude.XML.Type" "[] : List (env:DHALL_SIGIL).Prelude.XML.Type"
else else
service.genode.extraVfs service.genode.extraVfs
} }

View File

@ -31,7 +31,7 @@ in upstream // {
device_manager = callPackage ./device_manager { }; device_manager = callPackage ./device_manager { };
dhallGenode = dhallPackages.genode; dhallSigil = dhallPackages.sigil;
nic_bus = callPackage ./nic_bus { }; nic_bus = callPackage ./nic_bus { };

View File

@ -1,5 +1,5 @@
{ callPackage }: { callPackage }:
{ {
genode = callPackage ./genode.nix { }; sigil = callPackage ./sigil.nix { };
} }

View File

@ -1,11 +0,0 @@
{ lib, stdenv, fetchgit, dhallPackages }:
dhallPackages.buildDhallDirectoryPackage {
name = "dhall-genode";
src = fetchgit {
url = "https://git.sr.ht/~ehmry/dhall-genode";
rev = "0f782d2c5834c10330fcecd3dbd7c25c19e27ea1";
sha256 = "1w53w04pjb11d6348gr6ggnc9jdk5nqpi0171rpmba4lnrvrgvm7";
};
dependencies = [ dhallPackages.Prelude ];
}

11
packages/dhall/sigil.nix Normal file
View File

@ -0,0 +1,11 @@
{ lib, stdenv, fetchgit, dhallPackages }:
dhallPackages.buildDhallDirectoryPackage {
name = "dhall-sigil";
src = fetchgit {
url = "https://git.sr.ht/~ehmry/dhall-sigil";
rev = "e5a9bc19b23609b76512bc82173487671bd843db";
sha256 = "0inr4a0dn0201bcklj2x9inshqcmsn26fbh9wnyv7wac384fj47k";
};
dependencies = [ dhallPackages.Prelude ];
}

View File

@ -1,12 +1,12 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Prelude = Genode.Prelude let Prelude = Sigil.Prelude
let Libc = Genode.Libc let Libc = Sigil.Libc
let VFS = Genode.VFS let VFS = Sigil.VFS
let Init = Genode.Init let Init = Sigil.Init
let Child = Init.Child let Child = Init.Child
@ -25,9 +25,9 @@ in λ(params : { bash : Text, coreutils : Text }) →
Child.Attributes::{ Child.Attributes::{
, binary = "vfs" , binary = "vfs"
, provides = [ "File_system" ] , provides = [ "File_system" ]
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 8 , ram = Sigil.units.MiB 8
} }
, routes = , routes =
Prelude.List.map Prelude.List.map
@ -92,7 +92,7 @@ in λ(params : { bash : Text, coreutils : Text }) →
, provides = [ "ROM" ] , provides = [ "ROM" ]
, resources = Init.Resources::{ , resources = Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 32 , ram = Sigil.units.MiB 32
} }
, config = Init.Config::{ , config = Init.Config::{
, policies = , policies =
@ -108,9 +108,9 @@ in λ(params : { bash : Text, coreutils : Text }) →
Child.Attributes::{ Child.Attributes::{
, binary = "${params.bash}/bin/bash" , binary = "${params.bash}/bin/bash"
, exitPropagate = True , exitPropagate = True
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 8 , ram = Sigil.units.MiB 8
} }
, routes = , routes =
Prelude.List.map Prelude.List.map

View File

@ -1,19 +1,19 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Genode.Init let Init = Sigil.Init
let Child = Init.Child let Child = Init.Child
let Libc = Genode.Libc let Libc = Sigil.Libc
in λ(binary : Text) → in λ(binary : Text) →
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary , binary
, exitPropagate = True , exitPropagate = True
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 500 , caps = 500
, ram = Genode.units.MiB 10 , ram = Sigil.units.MiB 10
} }
, config = Libc.toConfig Libc::{ args = [ "hello" ] } , config = Libc.toConfig Libc::{ args = [ "hello" ] }
} }

View File

@ -5,18 +5,18 @@
genode.init.children.log = { genode.init.children.log = {
package = pkgs.genodePackages.test-log; package = pkgs.genodePackages.test-log;
configFile = pkgs.writeText "test-log.dhall" '' configFile = pkgs.writeText "test-log.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Child = Genode.Init.Child let Child = Sigil.Init.Child
in λ(binary : Text) in λ(binary : Text)
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary , binary
, exitPropagate = True , exitPropagate = True
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 500 , caps = 500
, ram = Genode.units.MiB 10 , ram = Sigil.units.MiB 10
} }
} }
''; '';

View File

@ -26,22 +26,22 @@
package = testNim; package = testNim;
extraInputs = with pkgs.genodePackages; [ libc stdcxx ]; extraInputs = with pkgs.genodePackages; [ libc stdcxx ];
configFile = builtins.toFile "nim.dhall" '' configFile = builtins.toFile "nim.dhall" ''
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Genode.Init let Init = Sigil.Init
let Child = Init.Child let Child = Init.Child
let Libc = Genode.Libc let Libc = Sigil.Libc
in λ(binary : Text) in λ(binary : Text)
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary , binary
, exitPropagate = True , exitPropagate = True
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 500 , caps = 500
, ram = Genode.units.MiB 10 , ram = Sigil.units.MiB 10
} }
, config = Libc.toConfig Libc.default , config = Libc.toConfig Libc.default
} }

View File

@ -1,16 +1,14 @@
let Test = ./test.dhall ? env:DHALL_GENODE_TEST let Test = ./test.dhall ? env:DHALL_SIGIL_TEST
let Genode = Test.Genode let Prelude = Sigil.Prelude
let Prelude = Genode.Prelude let Init = Sigil.Init
let Init = Genode.Init
let Child = Init.Child let Child = Init.Child
let Libc = Genode.Libc let Libc = Sigil.Libc
let VFS = Genode.VFS let VFS = Sigil.VFS
in λ(params : { bash : Text, coreutils : Text, script : Text }) → in λ(params : { bash : Text, coreutils : Text, script : Text }) →
let init = let init =
@ -49,9 +47,9 @@ in λ(params : { bash : Text, coreutils : Text, script : Text }) →
] ]
} }
, provides = [ "File_system" ] , provides = [ "File_system" ]
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 8 , ram = Sigil.units.MiB 8
} }
, routes = , routes =
Prelude.List.map Prelude.List.map
@ -67,7 +65,7 @@ in λ(params : { bash : Text, coreutils : Text, script : Text }) →
, provides = [ "ROM" ] , provides = [ "ROM" ]
, resources = Init.Resources::{ , resources = Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 4 , ram = Sigil.units.MiB 4
} }
, routes = , routes =
[ Init.ServiceRoute.parentLabel [ Init.ServiceRoute.parentLabel
@ -89,9 +87,9 @@ in λ(params : { bash : Text, coreutils : Text, script : Text }) →
, args = [ "bash", params.script ] , args = [ "bash", params.script ]
} }
, exitPropagate = True , exitPropagate = True
, resources = Genode.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 8 , ram = Sigil.units.MiB 8
} }
, routes = , routes =
[ { service = [ { service =

View File

@ -1,15 +1,15 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Prelude = Genode.Prelude let Prelude = Sigil.Prelude
let Init = Genode.Init let Init = Sigil.Init
in { Genode in { Genode
, Type = , Type =
{ children : Prelude.Map.Type Text Init.Child.Type { children : Prelude.Map.Type Text Init.Child.Type
, rom : Genode.BootModules.Type , rom : Sigil.BootModules.Type
} }
, default.rom = [] : Genode.BootModules.Type , default.rom = [] : Sigil.BootModules.Type
, initToChildren = , initToChildren =
λ(init : Init.Type) → λ(init : Init.Type) →
toMap toMap

View File

@ -1,10 +1,8 @@
let Test = ./test.dhall ? env:DHALL_GENODE_TEST let Test = ./test.dhall ? env:DHALL_SIGIL_TEST
let Genode = Test.Genode let XML = Sigil.Prelude.XML
let XML = Genode.Prelude.XML let Init = Sigil.Init
let Init = Genode.Init
let ServiceRoute = Init.ServiceRoute let ServiceRoute = Init.ServiceRoute
@ -42,7 +40,7 @@ in λ(guest : { linux : Text, dtb : Text, initrd : Text }) →
} }
} }
, provides = [ "Nic" ] , provides = [ "Nic" ]
, resources = Init.Resources::{ ram = Genode.units.MiB 8 } , resources = Init.Resources::{ ram = Sigil.units.MiB 8 }
} }
, earlycon = , earlycon =
Child.flat Child.flat
@ -62,7 +60,7 @@ in λ(guest : { linux : Text, dtb : Text, initrd : Text }) →
, binary = "vmm" , binary = "vmm"
, resources = Init.Resources::{ , resources = Init.Resources::{
, caps = 256 , caps = 256
, ram = Genode.units.MiB 256 , ram = Sigil.units.MiB 256
} }
, routes = , routes =
[ ServiceRoute.parent "VM" [ ServiceRoute.parent "VM"
@ -92,5 +90,5 @@ in λ(guest : { linux : Text, dtb : Text, initrd : Text }) →
in Test::{ in Test::{
, children = Test.initToChildren init , children = Test.initToChildren init
, rom = Genode.Boot.toRomPaths (toMap guest) , rom = Sigil.Boot.toRomPaths (toMap guest)
} }

View File

@ -1,6 +1,6 @@
let Genode = env:DHALL_GENODE let Sigil = env:DHALL_SIGIL
let Init = Genode.Init let Init = Sigil.Init
let Child = Init.Child let Child = Init.Child
@ -9,9 +9,6 @@ in λ(binary : Text) →
Child.Attributes::{ Child.Attributes::{
, binary , binary
, exitPropagate = True , exitPropagate = True
, resources = Init.Resources::{ , resources = Init.Resources::{ caps = 2048, ram = Sigil.units.MiB 256 }
, caps = 2048 , routes = [ Sigil.Init.ServiceRoute.parent "VM" ]
, ram = Genode.units.MiB 256
}
, routes = [ Genode.Init.ServiceRoute.parent "VM" ]
} }