2023-07-29 07:51:12 +00:00
|
|
|
{ lib
|
2024-02-04 17:39:46 +00:00
|
|
|
, stdenvNoCC
|
2023-07-29 07:51:12 +00:00
|
|
|
, fetchFromGitHub
|
2023-07-31 22:01:50 +00:00
|
|
|
, makeBinaryWrapper
|
2023-07-29 07:51:12 +00:00
|
|
|
, bc
|
2023-07-31 22:01:50 +00:00
|
|
|
, libnotify
|
2023-07-29 07:51:12 +00:00
|
|
|
, feh
|
|
|
|
, grim
|
|
|
|
, imagemagick
|
|
|
|
, slurp
|
|
|
|
, wl-clipboard
|
|
|
|
, xcolor
|
2024-02-04 17:39:46 +00:00
|
|
|
|
2023-07-29 07:51:12 +00:00
|
|
|
, waylandSupport ? true
|
|
|
|
, x11Support ? true
|
|
|
|
}:
|
|
|
|
|
2024-02-04 17:39:46 +00:00
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
2023-07-29 07:51:12 +00:00
|
|
|
pname = "farge";
|
|
|
|
version = "1.0.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sdushantha";
|
|
|
|
repo = "farge";
|
|
|
|
rev = "2ff6669e2350644d4f0b1bd84526efe5eae3c302";
|
|
|
|
hash = "sha256-vCMuFMGcI4D4EzbSsXeNGKNS6nBFkfTcAmSzb9UMArc=";
|
|
|
|
};
|
|
|
|
|
2023-07-31 22:01:50 +00:00
|
|
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
|
|
|
|
|
|
|
# Ensure the following programs are found within $PATH
|
|
|
|
wrapperPath = lib.makeBinPath ([
|
|
|
|
bc
|
|
|
|
feh
|
2024-02-04 17:39:46 +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-07-29 07:51:12 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2024-02-04 17:39:46 +00:00
|
|
|
install -Dm755 farge $out/bin/farge
|
2023-07-31 22:01:50 +00:00
|
|
|
wrapProgram $out/bin/farge \
|
2024-02-04 17:39:46 +00:00
|
|
|
--prefix PATH : "${finalAttrs.wrapperPath}"
|
2023-07-29 07:51:12 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-02-04 17:39:46 +00:00
|
|
|
description = "View the color value of a specific pixel on your screen";
|
2023-07-29 07:51:12 +00:00
|
|
|
homepage = "https://github.com/sdushantha/farge";
|
|
|
|
license = licenses.mit;
|
2024-02-04 17:39:46 +00:00
|
|
|
platforms = platforms.unix;
|
2023-07-31 22:01:50 +00:00
|
|
|
maintainers = with maintainers; [ jtbx justinlime ];
|
2023-07-29 07:51:12 +00:00
|
|
|
mainProgram = "farge";
|
|
|
|
};
|
|
|
|
})
|