From 3936d85ec3015bd91e9d605b26767b3c47964851 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 19 Jan 2021 16:29:29 +0100 Subject: [PATCH] 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. --- nixos/modules/system/boot/systemd.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index cbf9e7b49d3..6b672c7b2eb 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -263,7 +263,7 @@ let } (mkIf (config.preStart != "") { serviceConfig.ExecStartPre = - makeJobScript "${name}-pre-start" config.preStart; + [ (makeJobScript "${name}-pre-start" config.preStart) ]; }) (mkIf (config.script != "") { serviceConfig.ExecStart = @@ -271,7 +271,7 @@ let }) (mkIf (config.postStart != "") { serviceConfig.ExecStartPost = - makeJobScript "${name}-post-start" config.postStart; + [ (makeJobScript "${name}-post-start" config.postStart) ]; }) (mkIf (config.reload != "") { serviceConfig.ExecReload =