From d60a41053ea78ef23bf559f9226faff7132c0c2b Mon Sep 17 00:00:00 2001 From: Rahul Gopinath Date: Mon, 27 Jun 2016 12:05:38 -0700 Subject: [PATCH] dvtm: allow user configuration --- pkgs/tools/misc/dvtm/default.nix | 14 ++++++++++---- pkgs/top-level/all-packages.nix | 6 +++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/misc/dvtm/default.nix b/pkgs/tools/misc/dvtm/default.nix index f973f3d22645..767912ecc454 100644 --- a/pkgs/tools/misc/dvtm/default.nix +++ b/pkgs/tools/misc/dvtm/default.nix @@ -1,13 +1,15 @@ -{ stdenv, fetchurl, ncurses }: +{ stdenv, fetchurl, ncurses, customConfig ? null }: stdenv.mkDerivation rec { + name = "dvtm-0.15"; - meta = { + meta = with stdenv.lib; { description = "Dynamic virtual terminal manager"; homepage = http://www.brain-dump.org/projects/dvtm; - license = stdenv.lib.licenses.mit; - platfroms = stdenv.lib.platforms.linux; + license = licenses.mit; + platfroms = platforms.linux; + maintainers = [ maintainers.vrthra ]; }; src = fetchurl { @@ -15,6 +17,10 @@ stdenv.mkDerivation rec { sha256 = "0475w514b7i3gxk6khy8pfj2gx9l7lv2pwacmq92zn1abv01a84g"; }; + postPatch = stdenv.lib.optionalString (customConfig != null) '' + cp ${builtins.toFile "config.h" customConfig} ./config.h + ''; + buildInputs = [ ncurses ]; prePatch = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 98da5f419933..f2f96eba9ba1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1370,7 +1370,11 @@ in dvgrab = callPackage ../tools/video/dvgrab { }; - dvtm = callPackage ../tools/misc/dvtm { }; + dvtm = callPackage ../tools/misc/dvtm { + # if you prefer a custom config, write the config.h in dvtm.config.h + # and enable + # customConfig = builtins.readFile ./dvtm.config.h; + }; e2tools = callPackage ../tools/filesystems/e2tools { };