diff --git a/ci/install_compilers.sh b/ci/install_compilers.sh
index f6fb1680fbc68b7667413fab411151cd06a91688..f7055c697eaa108e81b89caa1a01e883a0f327e3 100755
--- a/ci/install_compilers.sh
+++ b/ci/install_compilers.sh
@@ -85,7 +85,7 @@ jq -Mrc '
 | .system_arch as $arch
 | .compilers
 | map(select(.constraint != null))
-| map(" - {when: \(.constraint), compilers_spec: [\(.spec) \($arch)]}")
+| map(" - when: \(.constraint)\n   compilers_specs: [\(.spec) \($arch)]")
 | .[]
 '  ${STACK_CONFIG} >> ${SPACK_SYSTEM_CONFIG_PATH}/compiler_definitions.yaml