about summary refs log tree commit diff
path: root/pkgs/larbs/dwm
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/larbs/dwm')
-rw-r--r--pkgs/larbs/dwm/default.nix59
1 files changed, 32 insertions, 27 deletions
diff --git a/pkgs/larbs/dwm/default.nix b/pkgs/larbs/dwm/default.nix
index 57ef1dc..8506c9b 100644
--- a/pkgs/larbs/dwm/default.nix
+++ b/pkgs/larbs/dwm/default.nix
@@ -1,29 +1,34 @@
-{ stdenv, fetchgit, libX11, libXinerama, libXft, xlibs, patches ? [] }:
+{ stdenv, fetchgit, libX11, libXinerama, libXft, xlibs, patches ? [], header_config_file ? null }:
 
 with stdenv.lib;
-
-stdenv.mkDerivation rec {
-  name = "dwm";
-  version = "1.0";
-
-  src = fetchgit {
-    url = "https://github.com/LukeSmithXYZ/dwm";
-    rev = "28d87d439359096e2f03f2e8582a481269de06be";
-    sha256 = "1fi0q68zqcmnx4spvjaqlv0k43ij96bz3545qdlc077qhzw2lxxh";
-  };
-
-  buildInputs = [ libX11 libXinerama libXft xlibs.libXext.dev ];
-
-  prePatch = ''sed -i "s@/usr/local@$out@" config.mk'';
-
-  inherit patches;
-
-  buildPhase = ''make LDFLAGS="-L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lX11-xcb -lxcb -lxcb-res -lXext"'';
-
-  meta = {
-    homepage = "https://github.com/LukeSmithXYZ/dwm";
-    description = "Luke's build of dwm";
-    license = stdenv.lib.licenses.mit;
-    platforms = with stdenv.lib.platforms; all;
-  };
-}
+let
+  customConfig = if header_config_file == null then "" else ''cp ${header_config_file} config.h'';
+in
+  stdenv.mkDerivation rec {
+    name = "dwm";
+    version = "1.0";
+
+    src = fetchgit {
+      url = "https://github.com/LukeSmithXYZ/dwm";
+      rev = "ad08183a60d259387955c8e5f5f319cc5b8a19c9";
+      sha256 = "12a9mhbk06hpllc2fqipr37vn2qwxd7xlqf1xyd6g72fjwvmp1w4";
+    };
+
+    buildInputs = [ libX11 libXinerama libXft xlibs.libXext.dev ];
+
+    prePatch = ''
+      sed -i "s@/usr/local@$out@" config.mk
+    ''
+    + customConfig;
+
+    inherit patches;
+
+    buildPhase = ''make LDFLAGS="-L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lX11-xcb -lxcb -lxcb-res -lXext"'';
+
+    meta = {
+      homepage = "https://github.com/LukeSmithXYZ/dwm";
+      description = "Luke's build of dwm";
+      license = stdenv.lib.licenses.mit;
+      platforms = with stdenv.lib.platforms; all;
+    };
+  }