writeShellApplication: Add runtimeEnv
argument
This commit is contained in:
parent
ac20bcf449
commit
a64766913f
@ -269,6 +269,7 @@ rec {
|
|||||||
{ name
|
{ name
|
||||||
, text
|
, text
|
||||||
, runtimeInputs ? [ ]
|
, runtimeInputs ? [ ]
|
||||||
|
, runtimeEnv ? null
|
||||||
, meta ? { }
|
, meta ? { }
|
||||||
, checkPhase ? null
|
, checkPhase ? null
|
||||||
, excludeShellChecks ? [ ]
|
, excludeShellChecks ? [ ]
|
||||||
@ -283,7 +284,15 @@ rec {
|
|||||||
text = ''
|
text = ''
|
||||||
#!${runtimeShell}
|
#!${runtimeShell}
|
||||||
${lib.concatMapStringsSep "\n" (option: "set -o ${option}") bashOptions}
|
${lib.concatMapStringsSep "\n" (option: "set -o ${option}") bashOptions}
|
||||||
'' + lib.optionalString (runtimeInputs != [ ]) ''
|
'' + lib.optionalString (runtimeEnv != null)
|
||||||
|
(lib.concatStrings
|
||||||
|
(lib.mapAttrsToList
|
||||||
|
(name: value: ''
|
||||||
|
${lib.toShellVar name value}
|
||||||
|
export ${name}
|
||||||
|
'')
|
||||||
|
runtimeEnv))
|
||||||
|
+ lib.optionalString (runtimeInputs != [ ]) ''
|
||||||
|
|
||||||
export PATH="${lib.makeBinPath runtimeInputs}:$PATH"
|
export PATH="${lib.makeBinPath runtimeInputs}:$PATH"
|
||||||
'' + ''
|
'' + ''
|
||||||
|
Loading…
Reference in New Issue
Block a user