summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/htgen/default.nix
blob: 14b6f4c582dc5e9ce238bdaa577ef715bb962d91 (plain)
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
{ fetchgit, lib, pkgs, stdenv }:
stdenv.mkDerivation rec {
  pname = "htgen";
  version = "1.3.1";

  #src = <htgen>;
  src = fetchgit {
    url = "http://cgit.krebsco.de/htgen";
    rev = "refs/tags/${version}";
    sha256 = "0ml8kp89bwkrwy6iqclzyhxgv2qn9dcpwaafbmsr4mgcl70zx22r";
  };

  installPhase = ''
    mkdir -p $out/bin
    {
      echo '#! ${pkgs.dash}/bin/dash'
      echo 'export PATH=${lib.makeBinPath [
        pkgs.coreutils
        pkgs.jq
        pkgs.ucspi-tcp
      ]}''${PATH+":$PATH"}'
      sed 's:^Server=htgen$:&/${version}:' htgen
    } > $out/bin/htgen
    chmod +x $out/bin/htgen
    cp -r examples $out
  '';
}