configuration/packages/git-diff-image.nix
2022-08-17 14:56:00 -07:00

66 lines
1.2 KiB
Nix

{ fetchFromGitHub
, lib
, makeWrapper
, stdenv
# Dependencies
, bash
, bc
, coreutils
, diffutils
, exiftool
, gnugrep
, gnused
, imagemagick
, xdg-utils
, xdpyinfo
}:
let
diffImagePath = lib.makeBinPath [
bash
bc
coreutils
diffutils
exiftool
gnugrep
gnused
imagemagick
xdg-utils
xdpyinfo
];
gitDiffImagePath = lib.makeBinPath [
bash
coreutils
diffutils
imagemagick
];
in
stdenv.mkDerivation {
pname = "git-diff-image";
version = "unstable-2020-12-15";
src = fetchFromGitHub {
owner = "ewanmellor";
repo = "git-diff-image";
rev = "8e66316d00ff78270ec09e1388738e30ac43a39d";
hash = "sha256-lFzyjSzDxu5gWIaKSe9gdfiw5K6nRG7frZ1igcqTH6E=";
};
buildInputs = [ makeWrapper ];
installPhase = ''
install -D -m755 -t $out/bin \
$src/diff-image \
$src/git_diff_image
wrapProgram $out/bin/diff-image --prefix PATH : ${diffImagePath}
wrapProgram $out/bin/git_diff_image --prefix PATH : ${gitDiffImagePath}
'';
meta = {
description = "An extension to 'git diff' that provides support for diffing images.";
homepage = "https://github.com/ewanmellor/git-diff-image";
license = lib.licenses.cc0;
mainProgram = "diff-image";
};
}