mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 03:30:45 +00:00
writeShellApplication: Add runtimeEnv
argument
This commit is contained in:
parent
ac20bcf449
commit
a64766913f
|
@ -269,6 +269,7 @@ rec {
|
|||
{ name
|
||||
, text
|
||||
, runtimeInputs ? [ ]
|
||||
, runtimeEnv ? null
|
||||
, meta ? { }
|
||||
, checkPhase ? null
|
||||
, excludeShellChecks ? [ ]
|
||||
|
@ -283,7 +284,15 @@ rec {
|
|||
text = ''
|
||||
#!${runtimeShell}
|
||||
${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"
|
||||
'' + ''
|
||||
|
|
Loading…
Reference in a new issue