lib.strings.toShellVar: Use isSimpleCoercibleString

Expecting no change in behavior.
This commit is contained in:
Robert Hensing 2022-12-28 23:40:08 +01:00
parent 2b4a8db032
commit 03063f65a5

View File

@ -395,7 +395,7 @@ rec {
*/
toShellVar = name: value:
lib.throwIfNot (isValidPosixName name) "toShellVar: ${name} is not a valid shell variable name" (
if isAttrs value && ! isCoercibleToString value then
if isAttrs value && ! isSimpleCoercibleToString value then
"declare -A ${name}=(${
concatStringsSep " " (lib.mapAttrsToList (n: v:
"[${escapeShellArg n}]=${escapeShellArg v}"