@@ -0,0 +1,37 @@
1+{ stdenv, fetchgit, libX11, libXinerama, libXft, patches ? [], conf ? null }:
2+
3+let
4+ name = "dwm-git-20180602";
5+in
6+
7+stdenv.mkDerivation {
8+ inherit name;
9+
10+ src = fetchgit {
11+ url = "git://git.suckless.org/dwm";
12+ rev = "b69c870a3076d78ab595ed1cd4b41cf6b03b2610";
13+ sha256 = "10i079h79l4gdch1qy2vrrb2xxxkgkjmgphr5r9a75jbbagwvz0k";
14+ };
15+
16+ buildInputs = [ libX11 libXinerama libXft ];
17+
18+ prePatch = ''sed -i "s@/usr/local@$out@" config.mk'';
19+
20+ # Allow users set their own list of patches
21+ inherit patches;
22+
23+ # Allow users to override the entire config file AFTER appying the patches
24+ postPatch = stdenv.lib.optionalString (conf!=null) ''
25+ echo -n '${conf}' > config.def.h
26+ '';
27+
28+ buildPhase = "make";
29+
30+ meta = with stdenv.lib; {
31+ homepage = https://suckless.org/;
32+ description = "Dynamic window manager for X, development version";
33+ license = licenses.mit;
34+ maintainers = with maintainers; [xeji];
35+ platforms = platforms.unix;
36+ };
37+}