diff options
Diffstat (limited to 'pkgs/applications/misc/dmenu/default.nix')
-rw-r--r-- | pkgs/applications/misc/dmenu/default.nix | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/pkgs/applications/misc/dmenu/default.nix b/pkgs/applications/misc/dmenu/default.nix index 109befe7594ce..089a421ccc151 100644 --- a/pkgs/applications/misc/dmenu/default.nix +++ b/pkgs/applications/misc/dmenu/default.nix @@ -1,7 +1,7 @@ -{ lib, stdenv, fetchurl, libX11, libXinerama, libXft, zlib, patches ? null -# update script dependencies -, gitUpdater -}: +{ lib, stdenv, fetchurl, libX11, libXinerama, libXft, zlib, writeText +, conf ? null, patches ? null + # update script dependencies +, gitUpdater }: stdenv.mkDerivation rec { pname = "dmenu"; @@ -16,9 +16,15 @@ stdenv.mkDerivation rec { inherit patches; - postPatch = '' + postPatch = let + configFile = if lib.isDerivation conf || builtins.isPath conf then + conf + else + writeText "config.def.h" conf; + in '' sed -ri -e 's!\<(dmenu|dmenu_path|stest)\>!'"$out/bin"'/&!g' dmenu_run sed -ri -e 's!\<stest\>!'"$out/bin"'/&!g' dmenu_path + ${lib.optionalString (conf != null) "cp ${configFile} config.def.h"} ''; preConfigure = '' @@ -27,15 +33,14 @@ stdenv.mkDerivation rec { makeFlags = [ "CC:=$(CC)" ]; - passthru.updateScript = gitUpdater { - url = "git://git.suckless.org/dmenu"; - }; + passthru.updateScript = gitUpdater { url = "git://git.suckless.org/dmenu"; }; meta = with lib; { - description = "Generic, highly customizable, and efficient menu for the X Window System"; + description = + "Generic, highly customizable, and efficient menu for the X Window System"; homepage = "https://tools.suckless.org/dmenu"; license = licenses.mit; - maintainers = with maintainers; [ pSub globin qusic ]; + maintainers = with maintainers; [ pSub globin qusic _0david0mp ]; platforms = platforms.all; mainProgram = "dmenu"; }; |