nixos/systemd: allow preStart with other ExecStartPre cmdlines

Declaring them as lists enables the concatenation, supporting
lib.mkBefore, lib.mkOrder, etc.

This is useful when you need to extend a service with a pre-start
script that needs to run as root.
This commit is contained in:
Robert Hensing 2021-01-19 16:29:29 +01:00
parent a141de9f3a
commit 3936d85ec3
1 changed files with 2 additions and 2 deletions

View File

@ -263,7 +263,7 @@ let
} }
(mkIf (config.preStart != "") (mkIf (config.preStart != "")
{ serviceConfig.ExecStartPre = { serviceConfig.ExecStartPre =
makeJobScript "${name}-pre-start" config.preStart; [ (makeJobScript "${name}-pre-start" config.preStart) ];
}) })
(mkIf (config.script != "") (mkIf (config.script != "")
{ serviceConfig.ExecStart = { serviceConfig.ExecStart =
@ -271,7 +271,7 @@ let
}) })
(mkIf (config.postStart != "") (mkIf (config.postStart != "")
{ serviceConfig.ExecStartPost = { serviceConfig.ExecStartPost =
makeJobScript "${name}-post-start" config.postStart; [ (makeJobScript "${name}-post-start" config.postStart) ];
}) })
(mkIf (config.reload != "") (mkIf (config.reload != "")
{ serviceConfig.ExecReload = { serviceConfig.ExecReload =