sigil/nixos-modules/eris/rom-fs.nix

66 lines
1.9 KiB
Nix

{ config, pkgs, lib, ... }:
{
config = lib.mkIf (config.genode.boot.storeBackend == "fs") {
genode.core.children.part_block = {
package = pkgs.genodePackages.part_block;
configFile = pkgs.writeText "part_block.dhall" ''
let Genode = env:DHALL_GENODE
let Init = Genode.Init
in λ(binary : Text) -> Init.Child.flat
Init.Child.Attributes::{
, binary
, resources = Init.Resources::{ ram = Genode.units.MiB 8 }
, config = Init.Config::{
, attributes = toMap { ignore_mbr = "yes" }
, policies =
[ Init.Config.Policy::{
, service = "Block"
, label = Init.LabelSelector.prefix "eris_vfs"
, attributes = toMap
{ partition = "${
toString config.fileSystems."/".block.partition
}"
, writeable = "yes"
, TODO = "select by partition UUID"
}
}
]
}
}
'';
};
genode.core.children.eris_vfs = let
vfsRump = lib.getEris' "lib" pkgs.genodePackages.rump "vfs_rump.lib.so";
in {
package = pkgs.genodePackages.vfs;
extraErisInputs = [ vfsRump ];
configFile = pkgs.writeText "rom-vfs.dhall" ''
let Genode = env:DHALL_GENODE
let VFS = Genode.VFS
in ${./rom-vfs.dhall}
Genode.Init.Resources::{ caps = 256, ram = Genode.units.MiB 16 }
( VFS.vfs
[ VFS.leafAttrs
"plugin"
(toMap { load = "${vfsRump.cap}", fs = "ext2fs", ram = "12M" })
]
)
'';
};
genode.core.children.eris_rom = {
package = pkgs.genodePackages.cached_fs_rom;
configFile = ./cached_fs_rom.dhall;
};
};
}