nixos/oci-containers: Remove dep on system.path

This commit is contained in:
Simon Žlender 2021-01-28 21:28:01 +01:00
parent 683f0b8938
commit ede24160fc

View File

@ -227,15 +227,11 @@ let
${cfg.backend} load -i ${container.imageFile} ${cfg.backend} load -i ${container.imageFile}
''} ''}
''; '';
postStop = "${cfg.backend} rm -f ${name} || true";
serviceConfig = { script = concatStringsSep " \\\n " ([
StandardOutput = "null"; "exec ${cfg.backend} run"
StandardError = "null";
ExecStart = concatStringsSep " \\\n " ([
"${config.system.path}/bin/${cfg.backend} run"
"--rm" "--rm"
"--name=${name}" "--name=${escapeShellArg name}"
"--log-driver=${container.log-driver}" "--log-driver=${container.log-driver}"
] ++ optional (container.entrypoint != null) ] ++ optional (container.entrypoint != null)
"--entrypoint=${escapeShellArg container.entrypoint}" "--entrypoint=${escapeShellArg container.entrypoint}"
@ -249,7 +245,12 @@ let
++ map escapeShellArg container.cmd ++ map escapeShellArg container.cmd
); );
ExecStop = ''${pkgs.bash}/bin/sh -c "[ $SERVICE_RESULT = success ] || ${cfg.backend} stop ${name}"''; preStop = "[ $SERVICE_RESULT = success ] || ${cfg.backend} stop ${name}";
postStop = "${cfg.backend} rm -f ${name} || true";
serviceConfig = {
StandardOutput = "null";
StandardError = "null";
### There is no generalized way of supporting `reload` for docker ### There is no generalized way of supporting `reload` for docker
### containers. Some containers may respond well to SIGHUP sent to their ### containers. Some containers may respond well to SIGHUP sent to their