From 1371d3df8ad77e2373b73f98d7c127d6cfd3ae43 Mon Sep 17 00:00:00 2001 From: syberant Date: Wed, 29 Jul 2020 01:17:52 +0200 Subject: [PATCH] dwm: add conf option Allow users to set their own config.def.h configuration file for dwm. --- pkgs/applications/window-managers/dwm/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/window-managers/dwm/default.nix b/pkgs/applications/window-managers/dwm/default.nix index 8f9c28c78511..7fddeb451fbd 100644 --- a/pkgs/applications/window-managers/dwm/default.nix +++ b/pkgs/applications/window-managers/dwm/default.nix @@ -1,4 +1,6 @@ -{stdenv, fetchurl, libX11, libXinerama, libXft, patches ? []}: +{stdenv, fetchurl, libX11, libXinerama, libXft, writeText, patches ? [], conf ? null}: + +with stdenv.lib; let name = "dwm-6.2"; @@ -18,6 +20,10 @@ stdenv.mkDerivation { # Allow users set their own list of patches inherit patches; + # Allow users to set the config.def.h file containing the configuration + postPatch = let configFile = if isDerivation conf || builtins.isPath conf then conf else writeText "config.def.h" conf; + in optionalString (conf!=null) "cp ${configFile} config.def.h"; + buildPhase = " make "; meta = {