From 8a6fad83f421bac4c59e1a0d424d1be49ababa35 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 14 Sep 2010 11:22:17 +0000 Subject: [PATCH] * Add a job attribute (path) to allow adding packages to the job's $PATH environment variable. svn path=/nixos/trunk/; revision=23780 --- modules/system/upstart/upstart.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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. + ''; + }; + };