nixos: pass binary seperately from args in systemd wrapper
This commit is contained in:
parent
bf4a673c98
commit
526e7bafc1
|
@ -16,7 +16,11 @@ let parentRoutes =
|
||||||
Prelude.List.map Text Init.ServiceRoute.Type Init.ServiceRoute.parent
|
Prelude.List.map Text Init.ServiceRoute.Type Init.ServiceRoute.parent
|
||||||
|
|
||||||
in λ ( params
|
in λ ( params
|
||||||
: { args : List Text, coreutils : Text, interface : Optional Text }
|
: { args : List Text
|
||||||
|
, binary : Text
|
||||||
|
, coreutils : Text
|
||||||
|
, interface : Optional Text
|
||||||
|
}
|
||||||
) →
|
) →
|
||||||
let socketsVfs =
|
let socketsVfs =
|
||||||
merge
|
merge
|
||||||
|
@ -112,7 +116,7 @@ in λ ( params
|
||||||
, ExecStart =
|
, ExecStart =
|
||||||
Child.flat
|
Child.flat
|
||||||
Child.Attributes::{
|
Child.Attributes::{
|
||||||
, binary = "bash"
|
, binary = params.binary
|
||||||
, exitPropagate = True
|
, exitPropagate = True
|
||||||
, resources = Genode.Init.Resources::{
|
, resources = Genode.Init.Resources::{
|
||||||
, caps = 256
|
, caps = 256
|
||||||
|
@ -125,10 +129,11 @@ in λ ( params
|
||||||
, stdout = Some "/dev/log"
|
, stdout = Some "/dev/log"
|
||||||
, stderr = Some "/dev/log"
|
, stderr = Some "/dev/log"
|
||||||
, pipe = Some "/dev/pipes"
|
, pipe = Some "/dev/pipes"
|
||||||
|
, rng = Some "/dev/random"
|
||||||
, rtc = Some "/dev/rtc"
|
, rtc = Some "/dev/rtc"
|
||||||
, socket = Some "/dev/sockets"
|
, socket = Some "/dev/sockets"
|
||||||
, vfs = [ VFS.leaf "fs" ]
|
, vfs = [ VFS.leaf "fs" ]
|
||||||
, args = params.args
|
, args = [ params.binary ] # params.args
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
with attributes = toMap { ld_verbose = "yes" }
|
with attributes = toMap { ld_verbose = "yes" }
|
||||||
|
|
|
@ -43,12 +43,14 @@ with lib; {
|
||||||
libc
|
libc
|
||||||
posix
|
posix
|
||||||
vfs
|
vfs
|
||||||
|
vfs_jitterentropy
|
||||||
vfs_pipe
|
vfs_pipe
|
||||||
];
|
];
|
||||||
configFile = let
|
configFile = let
|
||||||
args = ''[ "'' + concatStringsSep ''", "''
|
args = lib.strings.splitString " "
|
||||||
((lib.strings.splitString " ")
|
(toString service.serviceConfig.ExecStart);
|
||||||
(toString service.serviceConfig.ExecStart)) + ''" ]'';
|
binary = builtins.head args;
|
||||||
|
args' = ''[ "${concatStringsSep ''", "'' (builtins.tail args)}" ]'';
|
||||||
# TODO: service.environment;
|
# TODO: service.environment;
|
||||||
interface = if service.genode.interface == null then
|
interface = if service.genode.interface == null then
|
||||||
"None Text"
|
"None Text"
|
||||||
|
@ -56,7 +58,8 @@ with lib; {
|
||||||
''Some "${service.genode.interface}"'';
|
''Some "${service.genode.interface}"'';
|
||||||
in pkgs.writeText "${name'}.dhall" ''
|
in pkgs.writeText "${name'}.dhall" ''
|
||||||
${./systemd-runner.dhall} {
|
${./systemd-runner.dhall} {
|
||||||
, args = ${args}
|
, args = ${args'}
|
||||||
|
, binary = "${binary}"
|
||||||
, coreutils = "${pkgs.coreutils}"
|
, coreutils = "${pkgs.coreutils}"
|
||||||
, interface = ${interface}
|
, interface = ${interface}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue