2023-06-27 11:45:21 +00:00
|
|
|
name: default: let
|
|
|
|
envOverride = builtins.getEnv name;
|
|
|
|
logEnvOverride = value:
|
|
|
|
builtins.trace "getEnvWithDefault ${name} (default: ${toString default}): ${value}" value;
|
|
|
|
in
|
2024-01-11 09:27:28 +00:00
|
|
|
if envOverride != "" && envOverride != default
|
2023-06-27 11:45:21 +00:00
|
|
|
then logEnvOverride envOverride
|
|
|
|
else default
|