From b424c4346568701789b70604b40c389c9d535b1d Mon Sep 17 00:00:00 2001 From: Johannes Frankenau Date: Mon, 3 Jul 2017 14:16:20 +0200 Subject: [PATCH] sxiv: Add support for custom config --- pkgs/applications/graphics/sxiv/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/sxiv/default.nix b/pkgs/applications/graphics/sxiv/default.nix index e2d5357f814b..843352b27913 100644 --- a/pkgs/applications/graphics/sxiv/default.nix +++ b/pkgs/applications/graphics/sxiv/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchFromGitHub, libX11, imlib2, giflib, libexif }: +{ stdenv, fetchFromGitHub, libX11, imlib2, giflib, libexif, conf ? null }: + +with stdenv.lib; stdenv.mkDerivation rec { name = "sxiv-${version}"; @@ -16,12 +18,16 @@ stdenv.mkDerivation rec { --replace /usr/local $out ''; + configFile = optionalString (conf!=null) (builtins.toFile "config.def.h" conf); + preBuild = optionalString (conf!=null) "cp ${configFile} config.def.h"; + buildInputs = [ libX11 imlib2 giflib libexif ]; + meta = { description = "Simple X Image Viewer"; homepage = "https://github.com/muennich/sxiv"; license = stdenv.lib.licenses.gpl2Plus; platforms = stdenv.lib.platforms.linux; - maintainers = with stdenv.lib.maintainers; [ fuuzetsu ]; + maintainers = with maintainers; [ jfrankenau fuuzetsu ]; }; }