nixpkgs/pkgs/development/tools/ijq/default.nix
2024-03-02 12:01:44 -06:00

36 lines
923 B
Nix

{ buildGoModule, fetchFromSourcehut, lib, jq, installShellFiles, makeWrapper, scdoc }:
buildGoModule rec {
pname = "ijq";
version = "1.0.1";
src = fetchFromSourcehut {
owner = "~gpanders";
repo = pname;
rev = "v${version}";
sha256 = "sha256-su/PHUt4GpJxt9nm/oYnP1F8EDSl0fUgamWJj1TxuZA=";
};
vendorHash = "sha256-X91kW+dpcxd1+vTV1G1al5cdlwWpbUS85Xxf3yeVg1I=";
nativeBuildInputs = [ installShellFiles makeWrapper scdoc ];
ldflags = [ "-s" "-w" "-X main.Version=${version}" ];
postBuild = ''
scdoc < ijq.1.scd > ijq.1
installManPage ijq.1
'';
postInstall = ''
wrapProgram "$out/bin/ijq" \
--prefix PATH : "${lib.makeBinPath [ jq ]}"
'';
meta = with lib; {
description = "Interactive wrapper for jq";
homepage = "https://git.sr.ht/~gpanders/ijq";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ justinas SuperSandro2000 ];
};
}