Generalize $H^1_{dR}(X)=\mathrm{Hom} (\pi_1(X),\mathbb R)$ to fundamental Groupoid Let $X$ be a path-connected smooth manifold, it is known that: $$H^1(X):=H^1_{dR}(X)=\mathrm{Hom} (\pi_1(X),\mathbb R).$$ Explicitly, a closed one-form $\alpha$ gives a function on $\pi_1(X)$ by $[\gamma]\mapsto \int_\gamma \alpha$; and this only depends on the de Rham class $[\alpha]$ and the homotopy class of $[\gamma]$ due to Stokes' formula. So it is well-defined.
Now, let's consider the fundamental groupoid $\Pi_1(X)$ (objects are points of $X$ and morphisms are the homotopy classes of paths). We also take a closed one-form $\alpha$, then it seems that we can also get a map in a similar manner:
$$
\mathrm{Mor}_{\Pi_1(X)}(p,q) \to \mathbb R, \qquad [\gamma]\mapsto \int_\gamma \alpha
$$
where $p,q\in X$ and $\gamma$ is a path between $p$ and $q$. Although another path $\gamma'$ in the same homotopy class $[\gamma]$ will again yields the same value, the difference is that this is not invariant if we replace $\alpha$ by some $\alpha +d \eta$. Namely, we have to stay at $Z^1(X)$ and cannot go to $H^1(X)$. But in view of $H^1(X)=\mathrm{Hom} (\pi_1(X),\mathbb R)$, the collection of $\mathbb R$-valued homomorphisms on the morphism spaces of the fundamental groupoid $\Pi_1(X)$ should be still related to $Z^1(X)$ in some sense, I guess.
In short, as $\Pi_1(X)$ is often viewed as a generalization of $\pi_1(X)$, it should be interesting to ask in analogy: what should be a reasonable `generalization' of $H^1_{dR}(X)=\mathrm{Hom} (\pi_1(X),\mathbb R)$? 
 A: Here is one possibility.
If $Y\subset X$ is a closed submanifold, one can consider the relative de Rham cohomology $H^n(X,Y)$, which is the quotient of the closed $n$-forms whose restriction to $Y$ is $0$, modulo derivatives of $(n-1)$-forms whose restriction to $Y$ is $0$. 
 Given a class $[\omega]$ in $H^1(X,\{p,q\})$, we get a map $f_{[\omega]}:\mathrm{Mor}_{\Pi_1(X)}(p,q) \to \mathbb R$, $[\gamma]\mapsto\int_\gamma\omega$. The map $f_{[\omega]}$ is not a group homomorphism ($\mathrm{Mor}_{\Pi_1(X)}(p,q)$ is not a group), but it is a heap homomorphism, meaning $f_{[\omega]}( [\gamma_1\gamma_2^{-1}\gamma_3])=f_{[\omega]}([\gamma_1])-f_{[\omega]}([\gamma_2])+f_{[\omega]}([\gamma_3])$. For each $p$, $q\in X$, there is an identification
$$
H^1(X,\{p,q\}) = \operatorname{Hom}(\mathrm{Mor}_{\Pi_1(X)}(p,q),\mathbb{R}),
$$
where Hom means the set of heap homomorphisms.
A: I think the context to generalize to is this:  
Let $G$ be a Lie group, and $\pi$ the fundamental group of a manifold (assumed finitely generated).  Let $\rho\in Hom(\pi, G)$ be smooth, and $[\rho]\in Hom(\pi,G)/G$ where the quotient is some context-appropriate approximation to the conjugation orbit space (examples: the GIT quotient if $G$ is complex reductive, the orbit space if $G$ is compact, or the polystable quotient if $G$ is real reductive).  Then the tangent space to $[\rho]$ is $T_{[0]}(H^1(\pi;\mathfrak{g}_{Ad})/Stab(\rho))$.
In your setting you don't see the quotient since your group is abelian, and you don't see the tangent space since your hom-space is a vector space.
So now consider the fundamental groupoid $\Pi$ (again assumed finitely generated) instead of $\pi$ and think of $G$ as a groupoid with one object.  Then $Hom(\Pi,G)$ is the collection of groupoid homomorphisms.  Replace the conjugation action with the action of $G^{\Pi_0}$ given by $\alpha\cdot \rho(a):=\alpha(h(a))\rho(a)\alpha(t(a))^{-1}$, where $h$ is the head map and $t$ is the tail map with respect to the arrows in the groupoid.  Then the quotient of $Hom(\Pi, G)$ by $G^{\Pi_0}$ is equivalent to the original quotient $Hom(\pi,G)/G$, see Theorem 3.4 here.  In particular, the tangent spaces are equivalent too.
To see this in play for surface groups, with some discussion about the de Rham picture in the final section, I highly recommend:
Guruprasad, K.; Huebschmann, J.; Jeffrey, L.; Weinstein, A.
Group systems, groupoids, and moduli spaces of parabolic bundles. 
Duke Math. J. 89 (1997), no. 2, 377–412. 
A: I'm not sure if this answers your question or not, but it's true that, for a connected manifold $X\,,$ $H^1(X)\cong H^1(\Pi_1(X),\mathcal{O})\,,$ where on the right hand side we are taking groupoid cohomology with coefficients in $\mathcal{O}\,.$ This is related to the Riemann-Hilbert correspondence, and it's basically saying that $H^1(X)$ classifies affine bundles on $X$ with a flat connection, up to isomorphism.
This "generalizes" the fact that $H^1(X)\cong \text{Hom}(\pi_1(X),\mathbb{R})$ since $\text{Hom}(\pi_1(X),\mathbb{R})\cong H^1(\pi_1(X),\mathbb{R})\,.$
