2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
2024-02-07 01:22:34 +00:00
|
|
|
, stdenvNoCC
|
2023-08-04 22:07:22 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, makeBinaryWrapper
|
|
|
|
, bc
|
|
|
|
, libnotify
|
|
|
|
, feh
|
|
|
|
, grim
|
|
|
|
, imagemagick
|
|
|
|
, slurp
|
|
|
|
, wl-clipboard
|
|
|
|
, xcolor
|
2024-02-07 01:22:34 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
, waylandSupport ? true
|
|
|
|
, x11Support ? true
|
|
|
|
}:
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
2023-08-04 22:07:22 +00:00
|
|
|
pname = "farge";
|
|
|
|
version = "1.0.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sdushantha";
|
|
|
|
repo = "farge";
|
|
|
|
rev = "2ff6669e2350644d4f0b1bd84526efe5eae3c302";
|
|
|
|
hash = "sha256-vCMuFMGcI4D4EzbSsXeNGKNS6nBFkfTcAmSzb9UMArc=";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
|
|
|
|
|
|
|
# Ensure the following programs are found within $PATH
|
|
|
|
wrapperPath = lib.makeBinPath ([
|
|
|
|
bc
|
|
|
|
feh
|
2024-02-07 01:22:34 +00:00
|
|
|
libnotify # notify-send
|
|
|
|
# Needed to fix font rendering issue in imagemagick
|
|
|
|
(imagemagick.override { ghostscriptSupport = true; })
|
|
|
|
] ++ lib.optionals waylandSupport [
|
|
|
|
grim
|
|
|
|
slurp
|
|
|
|
wl-clipboard
|
|
|
|
] ++ lib.optional x11Support xcolor);
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2024-02-07 01:22:34 +00:00
|
|
|
install -Dm755 farge $out/bin/farge
|
2023-08-04 22:07:22 +00:00
|
|
|
wrapProgram $out/bin/farge \
|
2024-02-07 01:22:34 +00:00
|
|
|
--prefix PATH : "${finalAttrs.wrapperPath}"
|
2023-08-04 22:07:22 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-02-07 01:22:34 +00:00
|
|
|
description = "View the color value of a specific pixel on your screen";
|
2023-08-04 22:07:22 +00:00
|
|
|
homepage = "https://github.com/sdushantha/farge";
|
|
|
|
license = licenses.mit;
|
2024-02-07 01:22:34 +00:00
|
|
|
platforms = platforms.unix;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ jtbx justinlime ];
|
|
|
|
mainProgram = "farge";
|
|
|
|
};
|
|
|
|
})
|