Let $\mathfrak{g}$ be a finite dimensional simple Lie algebra over $\mathbf{C}$, and $\widehat{\mathfrak{g}}_\kappa$ the associated affine Lie algebra. It is the central extension of the loop algebra $\mathfrak{g}((t))$ using the invariant bilinear form $\kappa$ on $\mathfrak{g}$. Write $V_\kappa(\mathfrak{g})=\text{Ind}^{\widehat{\mathfrak{g}}_\kappa}_{\mathfrak{g}[[t]]\oplus \mathbf{C}c}\mathbf{C}$ for the Verma module of $\widehat{\mathfrak{g}}_\kappa$, where on $\mathbf{C}$, $\mathfrak{g}[[t]]$ acts by $0$ and the central element $c$ acts by $1$.

Is there a space (topological space, stack, etc.) $X$ whose cohomology is $H^*(X)=V_\kappa(\mathfrak{g})$?

For instance, if $Y$ is a smooth algebraic surface then $X=\coprod_{n\ge 0}\text{Hilb}^nY$ has cohomology of the form $V_\kappa(\mathfrak{h})$, where the vector space $\mathfrak{h}=H^*(Y)$ is viewed as a commutative Lie algebra with form $\kappa(\alpha,\beta)=\int_Y\alpha\wedge\beta$. I am curious if there is a construction for non-commutative Lie algebras.

If the natural thing is not to consider cohomology but some other functor from spaces to vector spaces, that is fine too (though ideally it would generalise the above example).