summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2021-01-19 16:29:29 +0100
committerRobert Hensing <robert@roberthensing.nl>2021-01-19 16:29:29 +0100
commit3936d85ec3015bd91e9d605b26767b3c47964851 (patch)
treeffa059dc505a2d1eea31c52ec3e15e39653ba1f6
parenta141de9f3a0d3c22f4dd6c8f1b8e7b90c245ea7a (diff)
downloadnixpkgs-3936d85ec3015bd91e9d605b26767b3c47964851.tar
nixpkgs-3936d85ec3015bd91e9d605b26767b3c47964851.tar.gz
nixpkgs-3936d85ec3015bd91e9d605b26767b3c47964851.tar.bz2
nixpkgs-3936d85ec3015bd91e9d605b26767b3c47964851.tar.lz
nixpkgs-3936d85ec3015bd91e9d605b26767b3c47964851.tar.xz
nixpkgs-3936d85ec3015bd91e9d605b26767b3c47964851.tar.zst
nixpkgs-3936d85ec3015bd91e9d605b26767b3c47964851.zip
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.
-rw-r--r--nixos/modules/system/boot/systemd.nix4
1 files 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 =