|
|
|
@ -5,7 +5,8 @@ with lib; {
|
|
|
|
|
type = types.attrsOf (types.submodule ({ name, config, ... }: { |
|
|
|
|
options.genode = { |
|
|
|
|
|
|
|
|
|
enable = lib.mkEnableOption "systemd unit to a Genode subsystem translation"; |
|
|
|
|
enable = |
|
|
|
|
lib.mkEnableOption "systemd unit to a Genode subsystem translation"; |
|
|
|
|
|
|
|
|
|
interface = lib.mkOption { |
|
|
|
|
type = with types; nullOr str; |
|
|
|
@ -32,6 +33,16 @@ with lib; {
|
|
|
|
|
description = "RAM quota in MiB"; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
fsPersistence = lib.mkOption { |
|
|
|
|
type = types.bool; |
|
|
|
|
default = false; |
|
|
|
|
description = '' |
|
|
|
|
Whether this service will have access to mutable and persistent storage. |
|
|
|
|
This space is shared among all services for which this option is available |
|
|
|
|
and UNIX permission bits are not honored. |
|
|
|
|
''; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
})); |
|
|
|
|
}; |
|
|
|
@ -56,6 +67,7 @@ with lib; {
|
|
|
|
|
vfs |
|
|
|
|
vfs_pipe |
|
|
|
|
]; |
|
|
|
|
inherit (service.genode) fsPersistence; |
|
|
|
|
configFile = let |
|
|
|
|
args = lib.strings.splitString " " |
|
|
|
|
(toString service.serviceConfig.ExecStart); |
|
|
|
@ -66,6 +78,7 @@ with lib; {
|
|
|
|
|
"None Text" |
|
|
|
|
else |
|
|
|
|
''Some "${service.genode.interface}"''; |
|
|
|
|
toBool = cond: if cond then "True" else "False"; |
|
|
|
|
in pkgs.writeText "${name'}.dhall" '' |
|
|
|
|
${./systemd-runner.dhall} { |
|
|
|
|
, args = ${args'} |
|
|
|
@ -73,10 +86,11 @@ with lib; {
|
|
|
|
|
, coreutils = "${pkgs.coreutils}" |
|
|
|
|
, extraVfs = ${ |
|
|
|
|
if service.genode.extraVfs == null then |
|
|
|
|
"[] : List (env:DHALL_PRELUDE).XML.Type" |
|
|
|
|
"[] : List (env:DHALL_GENODE).Prelude.XML.Type" |
|
|
|
|
else |
|
|
|
|
service.genode.extraVfs |
|
|
|
|
} |
|
|
|
|
, fsPersistence = ${toBool service.genode.fsPersistence} |
|
|
|
|
, interface = ${interface} |
|
|
|
|
, ramQuotaMiB = ${toString service.genode.ramQuota} |
|
|
|
|
} |
|
|
|
|