Is there a purely algebraic or categorical way to introduce the Chevalley-Eilenberg complex in the definition of Lie algebra cohomology?

In group cohomology, for example, the bar resolution of a group is equal to the chain complex associated to the nerve of the group when considered as a category; I wonder if something like this is also possible for the Chevalley-Eilenberg complex?

I know that the Chevalley-Eilenberg complex arises as the subcomplex of left-invariant differential forms on a Lie group, but apart from this geometric origin, its definition doesn't seem very natural to me, so it would be nice to have some algebraic or categorical construction as well.