btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / hy / hyprshot / package.nix
blob17be2088c727b194ba8cb4433674f244f82d591c
1 { stdenvNoCC
2 , lib
3 , fetchFromGitHub
4 , hyprland
5 , jq
6 , grim
7 , slurp
8 , wl-clipboard
9 , libnotify
10 , withFreeze ? true
11 , hyprpicker
12 , makeWrapper
15 stdenvNoCC.mkDerivation (finalAttrs: {
16   pname = "hyprshot";
17   version = "1.3.0";
19   src = fetchFromGitHub {
20     owner = "Gustash";
21     repo = "hyprshot";
22     rev = finalAttrs.version;
23     hash = "sha256-9taTmV357cWglMGuN3NLq3bfNneFthwV6y+Ml4qEeHA=";
24   };
26   nativeBuildInputs = [ makeWrapper ];
28   installPhase = ''
29     runHook preInstall
31     install -Dm755 hyprshot -t "$out/bin"
32     wrapProgram "$out/bin/hyprshot" \
33       --prefix PATH ":" ${lib.makeBinPath ([
34           hyprland jq grim slurp wl-clipboard libnotify
35         ] ++ lib.optionals withFreeze [ hyprpicker ])}
37     runHook postInstall
38   '';
40   meta = with lib; {
41     homepage = "https://github.com/Gustash/hyprshot";
42     description = "Hyprshot is an utility to easily take screenshots in Hyprland using your mouse";
43     license = licenses.gpl3Only;
44     maintainers = with maintainers; [ Cryolitia ];
45     mainProgram = "hyprshot";
46     platforms = hyprland.meta.platforms;
47   };