diff --git a/modules/system/upstart/upstart.nix b/modules/system/upstart/upstart.nix
index cb3975e694c3..535e612ed32c 100644
--- a/modules/system/upstart/upstart.nix
+++ b/modules/system/upstart/upstart.nix
@@ -39,7 +39,8 @@ let
${optionalString (job.stopOn != "") "stop on ${job.stopOn}"}
- env PATH=${makeSearchPath "bin" upstartPath}:${makeSearchPath "sbin" upstartPath}
+ env PATH=${makeSearchPath "bin" (job.path ++ upstartPath)}:${makeSearchPath "sbin" (job.path ++ upstartPath)}
+
${concatMapStrings (n: "env ${n}=\"${getAttr n job.environment}\"\n") (attrNames job.environment)}
${optionalString (job.preStart != "") ''
@@ -271,6 +272,15 @@ let
'';
};
+ path = mkOption {
+ default = [ ];
+ description = ''
+ Packages added to the job's PATH environment variable.
+ Both the bin and sbin
+ subdirectories of each package are added.
+ '';
+ };
+
};