Cohomology group for Lie algebras

Definition
Suppose $$L$$ and $$M$$ are both Lie algebras over a commutative unital ring $$R$$. Suppose $$\varphi:L \to \operatorname{Der}(M)$$ is a homomorphism of Lie algebras from $$L$$ to the derivation algebra of $$M$$ over $$R$$. In other words, this is a Lie algebra action of $$L$$ on $$M$$. In particular, $$M$$ is equipped with a $$L$$-module structure.

We are interested in defining the cohomology groups $$H^n_\varphi(L,M)$$ for nonnegative integers $$n$$. Each of these is an $$R$$-module and in particular has an abelian group structure.

In the special case that $$R = \mathbb{Z}$$, we are treating $$L$$ and $$M$$ both simply as Lie rings, and in this case the cohomology groups are merely abelian groups.