Add inheritPath argument to writeShellApplication (#382507)

This commit is contained in:
lassulus
2025-02-16 23:16:17 +07:00
committed by GitHub
@@ -269,6 +269,12 @@ rec {
Type: AttrSet
*/
derivationArgs ? { },
/*
Whether to inherit the current `$PATH` in the script.
Type: Bool
*/
inheritPath ? true
}:
writeTextFile {
inherit name meta passthru derivationArgs;
@@ -289,7 +295,7 @@ rec {
runtimeEnv))
+ lib.optionalString (runtimeInputs != [ ]) ''
export PATH="${lib.makeBinPath runtimeInputs}:$PATH"
export PATH="${lib.makeBinPath runtimeInputs}${lib.optionalString inheritPath ":$PATH"}"
'' + ''
${text}