erisPatch nixos modules
This commit is contained in:
parent
207da49692
commit
85a108bdb3
|
@ -3,10 +3,18 @@
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
localPackages = pkgs.buildPackages;
|
localPackages = pkgs.buildPackages;
|
||||||
|
|
||||||
binary = mkOption {
|
binary = mkOption {
|
||||||
description = "Program binary for this child.";
|
description = "Program binary for this child. Must be an ERIS URN";
|
||||||
type = types.path;
|
default = null;
|
||||||
|
type = types.nullOr
|
||||||
|
(types.str // { check = lib.strings.hasPrefix "urn:erisx2:"; });
|
||||||
|
example =
|
||||||
|
"urn:erisx2:AEAU4KT7AGJLA5BHPWFZ7HX2OVVNVFGDM2SIS726OPZBGXDED64QIDPHN2M5P5HIMOG3YDSWBGDPNUMZKCG4CRVU4DI5BOS5IJRFCSLQQY";
|
||||||
|
};
|
||||||
|
package = mkOption {
|
||||||
|
description = "Package to source the binary for this child.";
|
||||||
|
type = lib.types.package;
|
||||||
|
example = literalExample "pkg.genodePackages.init";
|
||||||
};
|
};
|
||||||
coreROMs = mkOption {
|
coreROMs = mkOption {
|
||||||
type = with types; listOf str;
|
type = with types; listOf str;
|
||||||
|
@ -22,6 +30,152 @@ let
|
||||||
default = [ ];
|
default = [ ];
|
||||||
type = types.listOf types.package;
|
type = types.listOf types.package;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
children' = with builtins;
|
||||||
|
lib.attrsets.mapAttrs (childName: child:
|
||||||
|
if child.binary != null then {
|
||||||
|
inherit (child) binary configFile;
|
||||||
|
roms = { };
|
||||||
|
} else
|
||||||
|
let bin = lib.getEris "bin" child.package;
|
||||||
|
in {
|
||||||
|
config = ''${child.configFile} "${bin.cap}"'';
|
||||||
|
binary = bin.cap;
|
||||||
|
roms = [{
|
||||||
|
name = bin.cap;
|
||||||
|
value = bin.path;
|
||||||
|
}] ++ lib.mapAttrsToList (path: cap: {
|
||||||
|
name = cap;
|
||||||
|
value = path;
|
||||||
|
}) bin.closure;
|
||||||
|
}) config.genode.core.children;
|
||||||
|
|
||||||
|
coreErisCaps = with builtins;
|
||||||
|
let pkgNames = [ "cached_fs_rom" "jitter_sponge" "rtc_drv" ];
|
||||||
|
in listToAttrs (map (name:
|
||||||
|
let pkg = pkgs.genodePackages.${name};
|
||||||
|
in {
|
||||||
|
inherit name;
|
||||||
|
value = lib.getEris "bin" pkg;
|
||||||
|
}) pkgNames);
|
||||||
|
|
||||||
|
tarball =
|
||||||
|
"${config.system.build.tarball}/tarball/${config.system.build.tarball.fileName}.tar";
|
||||||
|
|
||||||
|
/* romDirectories = filterAttrs (_: value: value != null) (mapAttrs (name: value:
|
||||||
|
if value.extraInputs == [ ] then
|
||||||
|
null
|
||||||
|
else
|
||||||
|
pkgs.symlinkJoin {
|
||||||
|
name = "${name}-rom";
|
||||||
|
paths = value.extraInputs;
|
||||||
|
}) config.genode.init.children);
|
||||||
|
*/
|
||||||
|
|
||||||
|
bootConfigFile = let
|
||||||
|
|
||||||
|
storeBackendInputs = {
|
||||||
|
fs = [ pkgs.genodePackages.rump ];
|
||||||
|
memory = [ config.system.build.tarball ];
|
||||||
|
}.${config.genode.boot.storeBackend};
|
||||||
|
|
||||||
|
coreInputs = with builtins;
|
||||||
|
concatMap (getAttr "extraInputs")
|
||||||
|
(attrValues config.genode.core.children);
|
||||||
|
|
||||||
|
mergeManifests = inputs:
|
||||||
|
with builtins;
|
||||||
|
let
|
||||||
|
f = head: input:
|
||||||
|
if hasAttr "manifest" input then
|
||||||
|
''
|
||||||
|
${head}, { mapKey = "${
|
||||||
|
lib.getName input
|
||||||
|
}", mapValue = ${input.manifest} }''
|
||||||
|
else
|
||||||
|
abort "${input.pname} does not have a manifest";
|
||||||
|
in (foldl' f "[" inputs) + "]";
|
||||||
|
|
||||||
|
addManifest = drv:
|
||||||
|
drv // {
|
||||||
|
manifest =
|
||||||
|
localPackages.runCommand "${drv.name}.dhall" { inherit drv; } ''
|
||||||
|
set -eu
|
||||||
|
echo -n '[' >> $out
|
||||||
|
find $drv/ -type f -printf ',{mapKey= "%p",mapValue="%p"}' >> $out
|
||||||
|
${if builtins.elem "lib" drv.outputs then
|
||||||
|
''
|
||||||
|
find ${drv.lib}/ -type f -printf ',{mapKey= "%p",mapValue="%p"}' >> $out''
|
||||||
|
else
|
||||||
|
""}
|
||||||
|
echo -n ']' >> $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
manifest =
|
||||||
|
# Manifests are Dhall metadata to be attached to every
|
||||||
|
# package to be used for dynamically buildings enviroments
|
||||||
|
# using Dhall expressions. Probably not worth pursuing.
|
||||||
|
pkgs.writeText "manifest.dhall" (mergeManifests (map addManifest
|
||||||
|
(with pkgs.genodePackages; storeBackendInputs ++ coreInputs))
|
||||||
|
+ lib.optionalString (config.genode.boot.romModules != { }) ''
|
||||||
|
# [ { mapKey = "romModules", mapValue = [ ${
|
||||||
|
lib.concatStringsSep ", " (lib.lists.flatten ((mapAttrsToList
|
||||||
|
(k: v: ''{ mapKey = "${k}", mapValue = "${v}" }'')
|
||||||
|
config.genode.boot.romModules)))
|
||||||
|
}] } ]'');
|
||||||
|
|
||||||
|
/* storeRomPolicies = mapAttrsToList
|
||||||
|
(name: value: '', { mapKey = "${name}", mapValue = "${value}" }'')
|
||||||
|
romDirectories;
|
||||||
|
*/
|
||||||
|
|
||||||
|
extraRoutes = lib.concatStringsSep ", " (lib.lists.flatten
|
||||||
|
(lib.mapAttrsToList (name: value:
|
||||||
|
map (suffix: ''
|
||||||
|
{ service =
|
||||||
|
{ name = "ROM"
|
||||||
|
, label =
|
||||||
|
Genode.Init.LabelSelector.Type.Partial
|
||||||
|
{ prefix = Some "nixos -> ${name}", suffix = Some "${suffix}" }
|
||||||
|
}
|
||||||
|
, route = Genode.Init.Route.parent (Some "${suffix}")
|
||||||
|
}
|
||||||
|
'') value.coreROMs) config.genode.init.children));
|
||||||
|
|
||||||
|
extraCoreChildren = "[ ${
|
||||||
|
lib.concatStringsSep ", " (lib.mapAttrsToList
|
||||||
|
(name: value: ''{ mapKey = "${name}", mapValue = ${value.config} }'')
|
||||||
|
children')
|
||||||
|
} ]";
|
||||||
|
|
||||||
|
in with coreErisCaps;
|
||||||
|
localPackages.runCommand "boot.dhall" { } ''
|
||||||
|
cat > $out << EOF
|
||||||
|
let Genode = env:DHALL_GENODE in
|
||||||
|
let VFS = Genode.VFS
|
||||||
|
let XML = Genode.Prelude.XML
|
||||||
|
in
|
||||||
|
${./store-wrapper.dhall}
|
||||||
|
{ binaries = {
|
||||||
|
, cached_fs_rom = "${cached_fs_rom.cap}"
|
||||||
|
, jitter_sponge = "${jitter_sponge.cap}"
|
||||||
|
, rtc_drv = "${rtc_drv.cap}"
|
||||||
|
}
|
||||||
|
, extraCoreChildren = ${extraCoreChildren}
|
||||||
|
, subinit = ${config.genode.init.configFile}
|
||||||
|
, storeSize = $(stat --format '%s' ${tarball})
|
||||||
|
, routes = [${extraRoutes} ] : List Genode.Init.ServiceRoute.Type
|
||||||
|
, bootManifest = ${manifest}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
|
|
||||||
|
erisContents = lib.attrsets.mapAttrsToList (urn: source: {
|
||||||
|
target = "eris/" + urn;
|
||||||
|
inherit source;
|
||||||
|
}) config.genode.init.romModules;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
options.genode = {
|
options.genode = {
|
||||||
|
|
||||||
|
@ -43,7 +197,7 @@ in {
|
||||||
type = with types;
|
type = with types;
|
||||||
attrsOf (submodule {
|
attrsOf (submodule {
|
||||||
options = {
|
options = {
|
||||||
inherit binary coreROMs extraInputs;
|
inherit binary coreROMs extraInputs package;
|
||||||
configFile = mkOption {
|
configFile = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -132,50 +286,7 @@ in {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config = {
|
||||||
|
|
||||||
addManifest = drv:
|
|
||||||
drv // {
|
|
||||||
manifest =
|
|
||||||
localPackages.runCommand "${drv.name}.dhall" { inherit drv; } ''
|
|
||||||
set -eu
|
|
||||||
echo -n '[' >> $out
|
|
||||||
find $drv/ -type f -printf ',{mapKey= "%p",mapValue="%p"}' >> $out
|
|
||||||
${if builtins.elem "lib" drv.outputs then
|
|
||||||
''
|
|
||||||
find ${drv.lib}/ -type f -printf ',{mapKey= "%p",mapValue="%p"}' >> $out''
|
|
||||||
else
|
|
||||||
""}
|
|
||||||
echo -n ']' >> $out
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
mergeManifests = inputs:
|
|
||||||
with builtins;
|
|
||||||
let
|
|
||||||
f = head: input:
|
|
||||||
if hasAttr "manifest" input then
|
|
||||||
''
|
|
||||||
${head}, { mapKey = "${
|
|
||||||
lib.getName input
|
|
||||||
}", mapValue = ${input.manifest} }''
|
|
||||||
else
|
|
||||||
abort "${input.pname} does not have a manifest";
|
|
||||||
in (foldl' f "[" inputs) + "]";
|
|
||||||
|
|
||||||
romDirectories = filterAttrs (_: value: value != null) (mapAttrs
|
|
||||||
(name: value:
|
|
||||||
if value.extraInputs == [ ] then
|
|
||||||
null
|
|
||||||
else
|
|
||||||
pkgs.symlinkJoin {
|
|
||||||
name = "${name}-rom";
|
|
||||||
paths = value.extraInputs;
|
|
||||||
}) config.genode.init.children);
|
|
||||||
|
|
||||||
tarball =
|
|
||||||
"${config.system.build.tarball}/tarball/${config.system.build.tarball.fileName}.tar";
|
|
||||||
in {
|
|
||||||
|
|
||||||
assertions = [{
|
assertions = [{
|
||||||
assertion = builtins.any (s:
|
assertion = builtins.any (s:
|
||||||
|
@ -184,25 +295,23 @@ in {
|
||||||
message = "invalid Genode core for this system";
|
message = "invalid Genode core for this system";
|
||||||
}];
|
}];
|
||||||
|
|
||||||
genode.boot.romModules = with pkgs.genodePackages;
|
genode.boot.romModules = with builtins;
|
||||||
let
|
let getBin = name: "${getAttr name pkgs.genodePackages}/bin/${name}";
|
||||||
getBin = name:
|
in listToAttrs (lib.lists.flatten
|
||||||
"${builtins.getAttr name pkgs.genodePackages}/bin/${name}";
|
((map (getAttr "roms") (attrValues children')) ++ (map
|
||||||
in {
|
({ cap, path, ... }: {
|
||||||
cached_fs_rom = getBin "cached_fs_rom";
|
name = cap;
|
||||||
init = "${init}/bin/init";
|
value = path;
|
||||||
jitter_sponge = "${jitter_sponge}/bin/jitter_sponge";
|
}) (attrValues coreErisCaps)))) // {
|
||||||
report_rom = "${report_rom}/bin/report_rom";
|
"init" = "${pkgs.genodePackages.init}/bin/init";
|
||||||
rtc_drv = "${rtc_drv}/bin/rtc_drv";
|
"report_rom" = "${pkgs.genodePackages.report_rom}/bin/report_rom";
|
||||||
vfs = "${vfs}/bin/vfs";
|
};
|
||||||
"vfs.lib.so" = "${vfs}/lib/vfs.lib.so";
|
|
||||||
};
|
|
||||||
|
|
||||||
genode.core.children =
|
genode.core.children =
|
||||||
# Component to steer the main fs to a specific partition
|
# Component to steer the main fs to a specific partition
|
||||||
(if config.genode.boot.storeBackend != "memory" then {
|
(if config.genode.boot.storeBackend != "memory" then {
|
||||||
part_block = {
|
part_block = {
|
||||||
binary = "${pkgs.genodePackages.part_block}/bin/part_block";
|
package = pkgs.genodePackages.part_block;
|
||||||
configFile = pkgs.writeText "part_block.dhall" ''
|
configFile = pkgs.writeText "part_block.dhall" ''
|
||||||
let Genode = env:DHALL_GENODE
|
let Genode = env:DHALL_GENODE
|
||||||
|
|
||||||
|
@ -234,7 +343,7 @@ in {
|
||||||
} else
|
} else
|
||||||
{ }) // {
|
{ }) // {
|
||||||
fs = {
|
fs = {
|
||||||
binary = "${pkgs.genodePackages.vfs}/bin/vfs";
|
package = pkgs.genodePackages.vfs;
|
||||||
configFile = let
|
configFile = let
|
||||||
vfsConfig = if config.genode.boot.storeBackend == "memory" then ''
|
vfsConfig = if config.genode.boot.storeBackend == "memory" then ''
|
||||||
VFS.vfs
|
VFS.vfs
|
||||||
|
@ -324,97 +433,16 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
genode.boot.configFile = let
|
# genode.boot.storePaths = builtins.attrValues romDirectories;
|
||||||
|
|
||||||
storeBackendInputs = {
|
genode.boot.configFile = bootConfigFile;
|
||||||
fs = [ pkgs.genodePackages.rump ];
|
|
||||||
memory = [ config.system.build.tarball ];
|
|
||||||
}.${config.genode.boot.storeBackend};
|
|
||||||
|
|
||||||
coreInputs = with builtins;
|
|
||||||
concatMap (getAttr "extraInputs")
|
|
||||||
(attrValues config.genode.core.children);
|
|
||||||
|
|
||||||
manifest =
|
|
||||||
# Manifests are Dhall metadata to be attached to every
|
|
||||||
# package to be used for dynamically buildings enviroments
|
|
||||||
# using Dhall expressions. Probably not worth pursuing.
|
|
||||||
pkgs.writeText "manifest.dhall" (mergeManifests (map addManifest
|
|
||||||
(with pkgs.genodePackages;
|
|
||||||
storeBackendInputs ++ [ cached_fs_rom jitter_sponge report_rom vfs ]
|
|
||||||
++ coreInputs))
|
|
||||||
+ lib.optionalString (config.genode.boot.romModules != { }) ''
|
|
||||||
# [ { mapKey = "romModules", mapValue = [ ${
|
|
||||||
toString ((mapAttrsToList
|
|
||||||
(k: v: '', { mapKey = "${k}", mapValue = "${v}" }'')
|
|
||||||
config.genode.boot.romModules) ++ (lib.attrsets.mapAttrsToList
|
|
||||||
(name: value:
|
|
||||||
''
|
|
||||||
, { mapKey = "${value.binary}", mapValue = "${value.binary}" }'')
|
|
||||||
config.genode.core.children))
|
|
||||||
}] } ]'');
|
|
||||||
|
|
||||||
storeRomPolicies = mapAttrsToList
|
|
||||||
(name: value: '', { mapKey = "${name}", mapValue = "${value}" }'')
|
|
||||||
romDirectories;
|
|
||||||
|
|
||||||
extraRoutes = lib.concatStringsSep ", " (lib.lists.flatten
|
|
||||||
(lib.mapAttrsToList (name: value:
|
|
||||||
map (suffix: ''
|
|
||||||
{ service =
|
|
||||||
{ name = "ROM"
|
|
||||||
, label =
|
|
||||||
Genode.Init.LabelSelector.Type.Partial
|
|
||||||
{ prefix = Some "nixos -> ${name}", suffix = Some "${suffix}" }
|
|
||||||
}
|
|
||||||
, route = Genode.Init.Route.parent (Some "${suffix}")
|
|
||||||
}
|
|
||||||
'') value.coreROMs) config.genode.init.children));
|
|
||||||
|
|
||||||
extraCoreChildren = "[ ${
|
|
||||||
toString (lib.mapAttrsToList (name: value:
|
|
||||||
''
|
|
||||||
, { mapKey = "${name}", mapValue = ${value.configFile} "${value.binary}" }'')
|
|
||||||
config.genode.core.children)
|
|
||||||
} ]";
|
|
||||||
|
|
||||||
in localPackages.runCommand "boot.dhall" { } ''
|
|
||||||
cat > $out << EOF
|
|
||||||
let Genode = env:DHALL_GENODE in
|
|
||||||
let VFS = Genode.VFS
|
|
||||||
let XML = Genode.Prelude.XML
|
|
||||||
in
|
|
||||||
${./store-wrapper.dhall}
|
|
||||||
{ extraCoreChildren = ${extraCoreChildren}
|
|
||||||
, subinit = ${config.genode.init.configFile}
|
|
||||||
, storeSize = $(stat --format '%s' ${tarball})
|
|
||||||
, storeRomPolicies = [${
|
|
||||||
toString storeRomPolicies
|
|
||||||
} ] : Genode.Prelude.Map.Type Text Text
|
|
||||||
, routes = [${extraRoutes} ] : List Genode.Init.ServiceRoute.Type
|
|
||||||
, bootManifest = ${manifest}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
|
|
||||||
genode.boot.storePaths = with builtins;
|
|
||||||
[ config.genode.init.configFile ] ++ (attrValues romDirectories);
|
|
||||||
|
|
||||||
# Create the tarball of the store to live in core ROM
|
# Create the tarball of the store to live in core ROM
|
||||||
system.build.tarball =
|
system.build.tarball =
|
||||||
pkgs.callPackage "${modulesPath}/../lib/make-system-tarball.nix" {
|
pkgs.callPackage "${modulesPath}/../lib/make-system-tarball.nix" {
|
||||||
contents = [ ];
|
extraInputs = lib.attrsets.mapAttrsToList (name: child: child.package)
|
||||||
storeContents = let
|
config.genode.init.children;
|
||||||
romDirs = mapAttrsToList (name: object: {
|
contents = erisContents;
|
||||||
symlink = "rom/${name}";
|
|
||||||
inherit object;
|
|
||||||
}) romDirectories;
|
|
||||||
configFiles = mapAttrsToList (name: child: {
|
|
||||||
symlink = "config/${name}.dhall";
|
|
||||||
object = pkgs.writeText "${name}.dhall"
|
|
||||||
"${child.configFile} ${child.binary}";
|
|
||||||
}) config.genode.init.children;
|
|
||||||
in romDirs ++ configFiles;
|
|
||||||
compressCommand = "cat";
|
compressCommand = "cat";
|
||||||
compressionExtension = "";
|
compressionExtension = "";
|
||||||
};
|
};
|
||||||
|
@ -427,14 +455,16 @@ in {
|
||||||
lndir -silent \
|
lndir -silent \
|
||||||
${pkgs.genodePackages.dhallGenode}/.cache \
|
${pkgs.genodePackages.dhallGenode}/.cache \
|
||||||
$XDG_CACHE_HOME
|
$XDG_CACHE_HOME
|
||||||
dhall text <<< "(env:DHALL_GENODE).Init.render (${config.genode.boot.configFile}).config" > $out
|
dhall text <<< "(env:DHALL_GENODE).Init.render (${bootConfigFile}).config" > $out
|
||||||
xmllint --noout $out
|
xmllint --noout $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
virtualisation.diskImage = let
|
virtualisation.diskImage = let
|
||||||
espImage = import ./lib/make-esp-fs.nix { inherit config pkgs; };
|
espImage = import ./lib/make-esp-fs.nix { inherit config pkgs; };
|
||||||
storeFsImage =
|
storeFsImage = pkgs.callPackage ./lib/make-ext2-fs.nix {
|
||||||
pkgs.callPackage ./lib/make-ext2-fs.nix { inherit config pkgs; };
|
inherit config lib pkgs;
|
||||||
|
contents = erisContents;
|
||||||
|
};
|
||||||
bootDriveImage = import ./lib/make-bootable-image.nix {
|
bootDriveImage = import ./lib/make-bootable-image.nix {
|
||||||
inherit config pkgs espImage storeFsImage;
|
inherit config pkgs espImage storeFsImage;
|
||||||
};
|
};
|
||||||
|
@ -442,12 +472,13 @@ in {
|
||||||
|
|
||||||
virtualisation.useBootLoader = config.genode.boot.storeBackend != "memory";
|
virtualisation.useBootLoader = config.genode.boot.storeBackend != "memory";
|
||||||
|
|
||||||
virtualisation.qemu.options =
|
virtualisation.qemu.options = let
|
||||||
let blockCommon = [ "-bios ${pkgs.buildPackages.buildPackages.OVMF.fd}/FV/OVMF.fd" ];
|
blockCommon =
|
||||||
in {
|
[ "-bios ${pkgs.buildPackages.buildPackages.OVMF.fd}/FV/OVMF.fd" ];
|
||||||
fs = blockCommon;
|
in {
|
||||||
memory = [ ];
|
fs = blockCommon;
|
||||||
}.${config.genode.boot.storeBackend};
|
memory = [ ];
|
||||||
|
}.${config.genode.boot.storeBackend};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,17 @@ let
|
||||||
cfg = config.genode.init;
|
cfg = config.genode.init;
|
||||||
|
|
||||||
binary = mkOption {
|
binary = mkOption {
|
||||||
description = "Program binary for this child.";
|
description = "Program binary for this child. Must be an ERIS URN.";
|
||||||
type = types.path;
|
default = null;
|
||||||
|
type = types.nullOr
|
||||||
|
(types.str // { check = lib.strings.hasPrefix "urn:erisx2:"; });
|
||||||
|
example =
|
||||||
|
"urn:erisx2:AEAU4KT7AGJLA5BHPWFZ7HX2OVVNVFGDM2SIS726OPZBGXDED64QIDPHN2M5P5HIMOG3YDSWBGDPNUMZKCG4CRVU4DI5BOS5IJRFCSLQQY";
|
||||||
|
};
|
||||||
|
package = mkOption {
|
||||||
|
description = "Package to source the binary for this child.";
|
||||||
|
type = lib.types.package;
|
||||||
|
example = literalExample "pkg.genodePackages.init";
|
||||||
};
|
};
|
||||||
coreROMs = mkOption {
|
coreROMs = mkOption {
|
||||||
type = with types; listOf str;
|
type = with types; listOf str;
|
||||||
|
@ -18,11 +27,41 @@ let
|
||||||
'';
|
'';
|
||||||
example = [ "platform_info" ];
|
example = [ "platform_info" ];
|
||||||
};
|
};
|
||||||
extraInputs = mkOption {
|
extraInputs =
|
||||||
description = "List of packages to build a ROM store with.";
|
# TODO: deprecated?
|
||||||
|
mkOption {
|
||||||
|
description = "List of packages to build a ROM store with.";
|
||||||
|
default = [ ];
|
||||||
|
type = types.listOf types.package;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraErisInputs = mkOption {
|
||||||
|
description = "List of ERIS inputs to add to the init closure.";
|
||||||
default = [ ];
|
default = [ ];
|
||||||
type = types.listOf types.package;
|
type = types.listOf types.attrs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
children' = with builtins;
|
||||||
|
lib.attrsets.mapAttrs (childName: child:
|
||||||
|
let
|
||||||
|
toRoms = { cap, closure, path }:
|
||||||
|
[{
|
||||||
|
name = cap;
|
||||||
|
value = path;
|
||||||
|
}] ++ (lib.mapAttrsToList (value: name: { inherit name value; })
|
||||||
|
closure);
|
||||||
|
extraRoms = lib.lists.flatten (map toRoms child.extraErisInputs);
|
||||||
|
in if child.binary != null then {
|
||||||
|
inherit (child) binary configFile;
|
||||||
|
roms = { }; # extraRoms;
|
||||||
|
} else
|
||||||
|
let bin = lib.getEris "bin" child.package;
|
||||||
|
in {
|
||||||
|
config = ''${child.configFile} "${bin.cap}"'';
|
||||||
|
binary = bin.cap;
|
||||||
|
roms = toRoms bin ++ extraRoms;
|
||||||
|
}) config.genode.init.children;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.genode.init = {
|
options.genode.init = {
|
||||||
|
@ -62,7 +101,7 @@ in {
|
||||||
type = with types;
|
type = with types;
|
||||||
attrsOf (submodule {
|
attrsOf (submodule {
|
||||||
options = {
|
options = {
|
||||||
inherit binary coreROMs extraInputs;
|
inherit binary coreROMs extraErisInputs extraInputs package;
|
||||||
|
|
||||||
routeToNics = lib.mkOption {
|
routeToNics = lib.mkOption {
|
||||||
type = with types; listOf str;
|
type = with types; listOf str;
|
||||||
|
@ -94,6 +133,12 @@ in {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
romModules = mkOption {
|
||||||
|
type = types.attrsOf types.path;
|
||||||
|
default = { };
|
||||||
|
description = "Attr set of initial ROM modules";
|
||||||
|
};
|
||||||
|
|
||||||
subinits =
|
subinits =
|
||||||
# Subinits are just a different kind of children.
|
# Subinits are just a different kind of children.
|
||||||
# Eventually this will be nested "genode.init" instances.
|
# Eventually this will be nested "genode.init" instances.
|
||||||
|
@ -102,7 +147,7 @@ in {
|
||||||
type = with types;
|
type = with types;
|
||||||
attrsOf (submodule {
|
attrsOf (submodule {
|
||||||
options = {
|
options = {
|
||||||
inherit binary coreROMs extraInputs;
|
inherit binary coreROMs extraErisInputs extraInputs;
|
||||||
configFile = mkOption {
|
configFile = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -121,7 +166,7 @@ in {
|
||||||
# TODO: convert the subinits to children
|
# TODO: convert the subinits to children
|
||||||
|
|
||||||
children = mapAttrs (name: value: {
|
children = mapAttrs (name: value: {
|
||||||
inherit (value) extraInputs;
|
inherit (value) extraErisInputs extraInputs;
|
||||||
configFile = pkgs.writeText "${name}.child.dhall" ''
|
configFile = pkgs.writeText "${name}.child.dhall" ''
|
||||||
let Genode = env:DHALL_GENODE
|
let Genode = env:DHALL_GENODE
|
||||||
|
|
||||||
|
@ -131,9 +176,9 @@ in {
|
||||||
|
|
||||||
configFile = let
|
configFile = let
|
||||||
|
|
||||||
children = lib.mapAttrsToList
|
children =
|
||||||
(name: value: '', `${name}` = ${value.configFile} "${value.binary}"'')
|
lib.mapAttrsToList (name: value: ", `${name}` = ${value.config} ")
|
||||||
cfg.children;
|
children';
|
||||||
|
|
||||||
nicRoutes = lib.mapAttrsToList (child: value:
|
nicRoutes = lib.mapAttrsToList (child: value:
|
||||||
(map (label: ''
|
(map (label: ''
|
||||||
|
@ -153,12 +198,16 @@ in {
|
||||||
in baseConfig // {
|
in baseConfig // {
|
||||||
, verbose = ${if config.genode.init.verbose then "True" else "False"}
|
, verbose = ${if config.genode.init.verbose then "True" else "False"}
|
||||||
, children = baseConfig.children # toMap {${toString children} }
|
, children = baseConfig.children # toMap {${toString children} }
|
||||||
, routes = baseConfig.routes # [${
|
, routes = baseConfig.routes # ([${
|
||||||
toString nicRoutes
|
toString nicRoutes
|
||||||
}] : List Genode.Init.ServiceRoute.Type
|
}] : List Genode.Init.ServiceRoute.Type)
|
||||||
} : Genode.Init.Type
|
} : Genode.Init.Type
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
romModules = with builtins;
|
||||||
|
listToAttrs (lib.lists.flatten
|
||||||
|
(map ({ roms, ... }: roms) (lib.lists.flatten (attrValues children'))));
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ in {
|
||||||
hardware.genode.framebuffer.enable = cfg.enable;
|
hardware.genode.framebuffer.enable = cfg.enable;
|
||||||
|
|
||||||
genode.core.children.nitpicker = mkIf cfg.enable {
|
genode.core.children.nitpicker = mkIf cfg.enable {
|
||||||
binary = "${pkgs.genodePackages.nitpicker}/bin/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_GENODE).Init
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
genode.core.children.consoleLog = mkIf cfg.consoleLog.enable {
|
genode.core.children.consoleLog = mkIf cfg.consoleLog.enable {
|
||||||
binary = "${pkgs.genodePackages.init}/bin/init";
|
binary = pkgs.genodePackages.init;
|
||||||
extraInputs = with pkgs.genodePackages; [
|
extraInputs = with pkgs.genodePackages; [
|
||||||
gui_fb
|
gui_fb
|
||||||
log_core
|
log_core
|
||||||
|
|
|
@ -25,7 +25,7 @@ with lib;
|
||||||
'');
|
'');
|
||||||
|
|
||||||
genode.core.children.ahci_drv = lib.mkIf cfg.enable {
|
genode.core.children.ahci_drv = lib.mkIf cfg.enable {
|
||||||
binary = "${pkgs.genodePackages.ahci_drv}/bin/ahci_drv";
|
package = pkgs.genodePackages.ahci_drv;
|
||||||
configFile = pkgs.writeText "ahci_drv.dhall" ''
|
configFile = pkgs.writeText "ahci_drv.dhall" ''
|
||||||
let Genode = env:DHALL_GENODE
|
let Genode = env:DHALL_GENODE
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ with lib;
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
genode.core.children.acpi_drv = {
|
genode.core.children.acpi_drv = {
|
||||||
binary = "${pkgs.genodePackages.acpi_drv}/bin/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 Genode = env:DHALL_GENODE
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
genode.core.children.platform_drv = {
|
genode.core.children.platform_drv = {
|
||||||
binary = "${pkgs.genodePackages.platform_drv}/bin/platform_drv";
|
package = pkgs.genodePackages.platform_drv;
|
||||||
configFile = let
|
configFile = let
|
||||||
policies =
|
policies =
|
||||||
map (policy: ", ${policy}") config.hardware.genode.platform.policies;
|
map (policy: ", ${policy}") config.hardware.genode.platform.policies;
|
||||||
|
|
|
@ -15,16 +15,11 @@ with lib;
|
||||||
|
|
||||||
genode.core.children.fb_drv =
|
genode.core.children.fb_drv =
|
||||||
mkIf config.hardware.genode.framebuffer.enable {
|
mkIf config.hardware.genode.framebuffer.enable {
|
||||||
binary = with pkgs.genodePackages;
|
|
||||||
{
|
|
||||||
boot = boot_fb_drv;
|
|
||||||
vesa = vesa_drv;
|
|
||||||
}.${config.hardware.genode.framebuffer.driver};
|
|
||||||
configFile = let
|
configFile = let
|
||||||
binary = with pkgs.genodePackages;
|
binary = with pkgs.genodePackages;
|
||||||
{
|
{
|
||||||
boot = "${boot_fb_drv}/bin/boot_fb_drv";
|
boot = boot_fb_drv;
|
||||||
vesa = "${vesa_drv}/bin/vesa_fb_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 Genode = env:DHALL_GENODE
|
||||||
|
|
|
@ -44,8 +44,7 @@ with lib;
|
||||||
else
|
else
|
||||||
null) config.genode.init.children);
|
null) config.genode.init.children);
|
||||||
in {
|
in {
|
||||||
assertion =
|
assertion = clientList == [ ] || length clientList == 1;
|
||||||
trace clientList (clientList == [ ] || length clientList == 1);
|
|
||||||
message = "Multiple routes to Nic ${name}, ${clientList}";
|
message = "Multiple routes to Nic ${name}, ${clientList}";
|
||||||
};
|
};
|
||||||
in lib.lists.concatMap
|
in lib.lists.concatMap
|
||||||
|
@ -79,10 +78,10 @@ with lib;
|
||||||
in {
|
in {
|
||||||
name = name';
|
name = name';
|
||||||
value = {
|
value = {
|
||||||
binary = with pkgs.genodePackages;
|
package = with pkgs.genodePackages;
|
||||||
{
|
{
|
||||||
ipxe = "${ipxe_nic_drv}/bin/ipxe_nic_drv";
|
ipxe = ipxe_nic_drv;
|
||||||
virtio = "${virtio_nic_drv}/bin/virtio_nic_drv";
|
virtio = virtio_nic_drv;
|
||||||
}.${interface.genode.driver};
|
}.${interface.genode.driver};
|
||||||
configFile = let
|
configFile = let
|
||||||
policy = lib.mapAttrsToList (childName: value:
|
policy = lib.mapAttrsToList (childName: value:
|
||||||
|
@ -119,17 +118,18 @@ with lib;
|
||||||
sockets = mapAttrs' (name: interface:
|
sockets = mapAttrs' (name: interface:
|
||||||
let
|
let
|
||||||
name' = name + ".sockets";
|
name' = name + ".sockets";
|
||||||
vfsPlugin = with pkgs.genodePackages;
|
vfsPlugin = lib.getEris "lib" (with pkgs.genodePackages;
|
||||||
{
|
{
|
||||||
lwip = "${vfs_lwip}/lib/vfs_lwip.lib.so";
|
lwip = vfs_lwip;
|
||||||
lxip = "${vfs_lxip}/lib/vfs_lxip.lib.so";
|
lxip = vfs_lxip;
|
||||||
}.${interface.genode.stack};
|
}.${interface.genode.stack});
|
||||||
in {
|
in {
|
||||||
name = name';
|
name = name';
|
||||||
value = if interface.genode.stack == null then
|
value = if interface.genode.stack == null then
|
||||||
null
|
null
|
||||||
else {
|
else {
|
||||||
binary = "${pkgs.genodePackages.vfs}/bin/vfs";
|
package = pkgs.genodePackages.vfs;
|
||||||
|
extraErisInputs = [ vfsPlugin ];
|
||||||
routeToNics = [ name ];
|
routeToNics = [ name ];
|
||||||
configFile = let
|
configFile = let
|
||||||
ram = {
|
ram = {
|
||||||
|
@ -144,7 +144,7 @@ with lib;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "load";
|
name = "load";
|
||||||
value = vfsPlugin;
|
value = vfsPlugin.cap;
|
||||||
}
|
}
|
||||||
] ++ lib.optionals (interface.ipv4.addresses != [ ])
|
] ++ lib.optionals (interface.ipv4.addresses != [ ])
|
||||||
(let addr = head interface.ipv4.addresses;
|
(let addr = head interface.ipv4.addresses;
|
||||||
|
|
|
@ -88,7 +88,7 @@ with lib;
|
||||||
|
|
||||||
genode.core.children.usb_block_drv =
|
genode.core.children.usb_block_drv =
|
||||||
mkIf config.hardware.genode.usb.storage.enable {
|
mkIf config.hardware.genode.usb.storage.enable {
|
||||||
binary = "${pkgs.genodePackages.usb_block_drv}/bin/usb_block_drv";
|
binary = pkgs.genodePackages.usb_block_drv;
|
||||||
configFile = builtins.toFile "usb_block_drv.dhall" ''
|
configFile = builtins.toFile "usb_block_drv.dhall" ''
|
||||||
let Genode = env:DHALL_GENODE
|
let Genode = env:DHALL_GENODE
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,15 @@
|
||||||
{ config, pkgs }:
|
{ config, lib, pkgs, extraInputs ? [ ], contents }:
|
||||||
|
|
||||||
let
|
let
|
||||||
grub' = pkgs.buildPackages.grub2_efi;
|
grub' = pkgs.buildPackages.grub2_efi;
|
||||||
sdClosureInfo = pkgs.buildPackages.closureInfo {
|
sdClosureInfo = pkgs.buildPackages.closureInfo {
|
||||||
rootPaths = config.genode.boot.storePaths;
|
rootPaths = config.genode.boot.storePaths;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
copyEris = lib.strings.concatMapStrings ({ source, target }: ''
|
||||||
|
cp -a --reflink=auto -t "./rootImage/${target}" "${source}"
|
||||||
|
'') contents;
|
||||||
|
|
||||||
in pkgs.stdenv.mkDerivation {
|
in pkgs.stdenv.mkDerivation {
|
||||||
name = "ext2-fs.img.zstd";
|
name = "ext2-fs.img.zstd";
|
||||||
|
|
||||||
|
@ -49,6 +54,8 @@ in pkgs.stdenv.mkDerivation {
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
${copyEris}
|
||||||
|
|
||||||
# Also include a manifest of the closures in a format suitable for nix-store --load-db
|
# Also include a manifest of the closures in a format suitable for nix-store --load-db
|
||||||
cp ${sdClosureInfo}/registration ./rootImage/nix-path-registration
|
cp ${sdClosureInfo}/registration ./rootImage/nix-path-registration
|
||||||
|
|
||||||
|
|
|
@ -13,10 +13,11 @@ let ChildMapType = TextMapType Child.Type
|
||||||
let Manifest/Type = TextMapType (TextMapType Text)
|
let Manifest/Type = TextMapType (TextMapType Text)
|
||||||
|
|
||||||
in λ ( params
|
in λ ( params
|
||||||
: { extraCoreChildren : ChildMapType
|
: { binaries :
|
||||||
|
{ cached_fs_rom : Text, jitter_sponge : Text, rtc_drv : Text }
|
||||||
|
, extraCoreChildren : ChildMapType
|
||||||
, subinit : Init.Type
|
, subinit : Init.Type
|
||||||
, storeSize : Natural
|
, storeSize : Natural
|
||||||
, storeRomPolicies : Prelude.Map.Type Text Text
|
|
||||||
, routes : List Init.ServiceRoute.Type
|
, routes : List Init.ServiceRoute.Type
|
||||||
, bootManifest : Manifest/Type
|
, bootManifest : Manifest/Type
|
||||||
}
|
}
|
||||||
|
@ -46,7 +47,7 @@ in λ ( params
|
||||||
"rtc"
|
"rtc"
|
||||||
( Child.flat
|
( Child.flat
|
||||||
Child.Attributes::{
|
Child.Attributes::{
|
||||||
, binary = "rtc_drv"
|
, binary = params.binaries.rtc_drv
|
||||||
, routes = [ Init.ServiceRoute.parent "IO_PORT" ]
|
, routes = [ Init.ServiceRoute.parent "IO_PORT" ]
|
||||||
, config = Init.Config::{
|
, config = Init.Config::{
|
||||||
, policies =
|
, policies =
|
||||||
|
@ -62,7 +63,7 @@ in λ ( params
|
||||||
"jitter_sponge"
|
"jitter_sponge"
|
||||||
( Child.flat
|
( Child.flat
|
||||||
Child.Attributes::{
|
Child.Attributes::{
|
||||||
, binary = "jitter_sponge"
|
, binary = params.binaries.jitter_sponge
|
||||||
, config = Init.Config::{
|
, config = Init.Config::{
|
||||||
, policies =
|
, policies =
|
||||||
[ Init.Config.Policy::{
|
[ Init.Config.Policy::{
|
||||||
|
@ -77,11 +78,14 @@ in λ ( params
|
||||||
"store_rom"
|
"store_rom"
|
||||||
( Child.flat
|
( Child.flat
|
||||||
Child.Attributes::{
|
Child.Attributes::{
|
||||||
, binary = "cached_fs_rom"
|
, binary = params.binaries.cached_fs_rom
|
||||||
, resources = Init.Resources::{
|
, resources = Init.Resources::{
|
||||||
, ram = params.storeSize + Genode.units.MiB 1
|
, ram = params.storeSize + Genode.units.MiB 1
|
||||||
}
|
}
|
||||||
, config = Init.Config::{
|
, config = Init.Config::{
|
||||||
|
, defaultPolicy = Some Init.Config.DefaultPolicy::{
|
||||||
|
, attributes = toMap { directory = "/eris" }
|
||||||
|
}
|
||||||
, policies =
|
, policies =
|
||||||
let directStoreROMs =
|
let directStoreROMs =
|
||||||
Prelude.List.map
|
Prelude.List.map
|
||||||
|
@ -106,49 +110,22 @@ in λ ( params
|
||||||
params.subinit.children
|
params.subinit.children
|
||||||
)
|
)
|
||||||
|
|
||||||
let indirectStoreROMS =
|
|
||||||
let Entry = Prelude.Map.Entry Text Text
|
|
||||||
|
|
||||||
in Prelude.List.concatMap
|
|
||||||
Entry
|
|
||||||
Init.Config.Policy.Type
|
|
||||||
( λ(e : Entry) →
|
|
||||||
[ Init.Config.Policy::{
|
|
||||||
, service = "ROM"
|
|
||||||
, label =
|
|
||||||
Init.LabelSelector.prefix
|
|
||||||
"nixos -> ${e.mapKey}"
|
|
||||||
, attributes = toMap
|
|
||||||
{ directory =
|
|
||||||
"${e.mapValue}/bin"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
, Init.Config.Policy::{
|
|
||||||
, service = "ROM"
|
|
||||||
, label =
|
|
||||||
Init.LabelSelector.Type.Partial
|
|
||||||
{ prefix = Some
|
|
||||||
"nixos -> ${e.mapKey}"
|
|
||||||
, suffix = Some ".so"
|
|
||||||
}
|
|
||||||
, attributes = toMap
|
|
||||||
{ directory =
|
|
||||||
"${e.mapValue}/lib"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
)
|
|
||||||
params.storeRomPolicies
|
|
||||||
|
|
||||||
in [ Init.Config.Policy::{
|
in [ Init.Config.Policy::{
|
||||||
, service = "ROM"
|
, service = "ROM"
|
||||||
, label =
|
, label =
|
||||||
Init.LabelSelector.prefix
|
Init.LabelSelector.prefix
|
||||||
"nixos -> /nix/store"
|
"nixos -> /nix/store"
|
||||||
}
|
}
|
||||||
|
, Init.Config.Policy::{
|
||||||
|
, attributes = toMap
|
||||||
|
{ directory = "/eris" }
|
||||||
|
, label =
|
||||||
|
Init.LabelSelector.prefix
|
||||||
|
"nixos -> "
|
||||||
|
, service = "ROM"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
# directStoreROMs
|
# directStoreROMs
|
||||||
# indirectStoreROMS
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
};
|
};
|
||||||
genode.boot.storeBackend = "fs";
|
genode.boot.storeBackend = "fs";
|
||||||
genode.init.children.hello = {
|
genode.init.children.hello = {
|
||||||
binary = "${pkgs.hello}/bin/hello";
|
package = pkgs.hello;
|
||||||
configFile = ./hello.dhall;
|
configFile = ./hello.dhall;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
name = "bash";
|
name = "bash";
|
||||||
machine = { pkgs, ... }: {
|
machine = { pkgs, ... }: {
|
||||||
genode.init.children.bash = {
|
genode.init.children.bash = {
|
||||||
binary = "${pkgs.genodePackages.init}/bin/init";
|
package = pkgs.genodePackages.init;
|
||||||
configFile = pkgs.writeText "bash.child.dhall" ''
|
configFile = pkgs.writeText "bash.child.dhall" ''
|
||||||
${
|
${
|
||||||
./bash.dhall
|
./bash.dhall
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
{
|
{
|
||||||
name = "hello";
|
name = "hello";
|
||||||
machine = { pkgs, ... }: {
|
machine = { pkgs, ... }: {
|
||||||
|
genode.init.verbose = true;
|
||||||
genode.init.children.hello = {
|
genode.init.children.hello = {
|
||||||
binary = "${pkgs.hello}/bin/hello";
|
package = pkgs.hello;
|
||||||
configFile = ./hello.dhall;
|
configFile = ./hello.dhall;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ system, localSystem, crossSystem
|
{ system, localSystem, crossSystem
|
||||||
# Nixpkgs, for qemu, lib and more
|
# Nixpkgs, for qemu, lib and more
|
||||||
, pkgs, modulesPath
|
, pkgs, lib, modulesPath
|
||||||
# NixOS configuration to add to the VMs
|
# NixOS configuration to add to the VMs
|
||||||
, extraConfigurations ? [ ] }:
|
, extraConfigurations ? [ ] }:
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ rec {
|
||||||
buildVM = nodes: configurations:
|
buildVM = nodes: configurations:
|
||||||
|
|
||||||
import "${modulesPath}/../lib/eval-config.nix" {
|
import "${modulesPath}/../lib/eval-config.nix" {
|
||||||
inherit system;
|
inherit lib system;
|
||||||
modules = configurations ++ extraConfigurations;
|
modules = configurations ++ extraConfigurations;
|
||||||
baseModules = (import "${modulesPath}/module-list.nix") ++ [
|
baseModules = (import "${modulesPath}/module-list.nix") ++ [
|
||||||
../../nixos-modules/file-systems.nix
|
../../nixos-modules/file-systems.nix
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
with import ./build-vms.nix {
|
with import ./build-vms.nix {
|
||||||
inherit system localSystem crossSystem pkgs extraConfigurations;
|
inherit system localSystem crossSystem pkgs extraConfigurations;
|
||||||
|
inherit (flake) lib;
|
||||||
modulesPath = "${flake.inputs.nixpkgs}/nixos/modules";
|
modulesPath = "${flake.inputs.nixpkgs}/nixos/modules";
|
||||||
};
|
};
|
||||||
with pkgs.buildPackages.buildPackages;
|
with pkgs.buildPackages.buildPackages;
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
name = "lighttpd";
|
|
||||||
machine = { pkgs, ... }: {
|
|
||||||
imports = [ ../nixos-modules/systemd.nix ];
|
|
||||||
services.lighttpd = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
systemd.services.lighttpd.genode.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,12 +1,11 @@
|
||||||
{
|
{
|
||||||
name = "log";
|
name = "log";
|
||||||
machine = { pkgs, ... }: {
|
machine = { lib, pkgs, ... }: {
|
||||||
|
|
||||||
genode.init.children.log = {
|
genode.init.children.log = {
|
||||||
binary = "${pkgs.genodePackages.test-log}/bin/test-log";
|
package = pkgs.genodePackages.test-log;
|
||||||
configFile = pkgs.writeText "test-log.dhall" ''
|
configFile = pkgs.writeText "test-log.dhall" ''
|
||||||
let Genode =
|
let Genode = env:DHALL_GENODE
|
||||||
env:DHALL_GENODE
|
|
||||||
? https://git.sr.ht/~ehmry/dhall-genode/blob/master/package.dhall
|
|
||||||
|
|
||||||
let Child = Genode.Init.Child
|
let Child = Genode.Init.Child
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
binary = "${testNim}/bin/test_nim";
|
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 Genode = env:DHALL_GENODE
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
all (f: any f specs) [ (spec: spec == "nova") (spec: spec == "x86") ];
|
all (f: any f specs) [ (spec: spec == "nova") (spec: spec == "x86") ];
|
||||||
machine = { pkgs, ... }: {
|
machine = { pkgs, ... }: {
|
||||||
genode.init.children.vmm = {
|
genode.init.children.vmm = {
|
||||||
binary = "${pkgs.genodePackages.test-vmm_x86}/bin/test-vmm_x86";
|
package = pkgs.genodePackages.test-vmm_x86;
|
||||||
configFile = ./vmm_x86.dhall;
|
configFile = ./vmm_x86.dhall;
|
||||||
coreROMs = [ "platform_info" ];
|
coreROMs = [ "platform_info" ];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue