aboutsummaryrefslogtreecommitdiff
path: root/pkgs/check_json/default.nix
blob: eb9ceeda6bad3a9154d352b77d352ebfc32818ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ stdenv, pkgs, makeWrapper }:

stdenv.mkDerivation {
  name = "check_json";
  outputs = [ "out" "conf" ];
  unpackPhase = ":";
  nativeBuildInputs = [ makeWrapper ];
  installPhase = ''
    mkdir -p $out/bin

    cp ${./check_json} $out/bin/check_json
    cp ${./check_json.conf} $conf

    chmod +x "$out/bin/"*

    substituteInPlace "$conf" \
      --replace check_json "$out/bin/check_json"

    wrapProgram "$out/bin/check_json" \
      --prefix PATH : "${pkgs.curl.bin}/bin:${pkgs.gnugrep}/bin:${pkgs.jq}/bin"
  '';
}