summary refs log tree commit diff
path: root/pkgs/tools/graphics/imgur-screenshot/default.nix
blob: d1badc735095965de47e331a36979671d4030dc0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ stdenv, fetchFromGitHub, makeWrapper, curl, gnugrep, libnotify, scrot, which, xclip }:

let deps = stdenv.lib.makeSearchPath "bin" [ curl gnugrep libnotify scrot which xclip ];
in stdenv.mkDerivation rec {
  version = "1.5.4";
  name = "imgur-screenshot-${version}";

  src = fetchFromGitHub {
    owner = "jomo";
    repo = "imgur-screenshot";
    rev = "v${version}";
    sha256 = "1ff88mvrd0b7nmrkjljs3rnprk5ih0iif92dn39s3vnag3fp9f10";
  };

  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    install -Dm755 imgur-screenshot.sh $out/bin/imgur-screenshot
    wrapProgram $out/bin/imgur-screenshot --prefix PATH ':' ${deps}
  '';

  meta = with stdenv.lib; {
    description = "A tool for easy screencapping and uploading to imgur.";
    homepage = "https://https://github.com/jomo/imgur-screenshot/";
    platforms = platforms.linux;
    license = licenses.mit;
    maintainers = with maintainers; [ lw ];
  };
}