stockholm/krebs/5pkgs/simple/htgen/default.nix

29 lines
670 B
Nix
Raw Normal View History

2017-04-13 14:25:17 +00:00
{ coreutils, dash, fetchgit, gnused, stdenv, ucspi-tcp }:
2017-03-16 19:56:08 +00:00
with import <stockholm/lib>;
let
2020-04-30 14:46:41 +00:00
version = "1.2.3";
2017-03-16 19:56:08 +00:00
in stdenv.mkDerivation {
name = "htgen-${version}";
src = fetchgit {
url = "http://cgit.krebsco.de/htgen";
2017-03-16 20:53:05 +00:00
rev = "refs/tags/v${version}";
2020-04-30 14:46:41 +00:00
sha256 = "0lml336w31ckgspp633ym2jnppzln3f8mvmy3y2vz9yanf59j0hb";
2017-03-16 19:56:08 +00:00
};
installPhase = ''
mkdir -p $out/bin
{
2017-04-13 14:25:17 +00:00
echo '#! ${dash}/bin/dash'
2017-03-16 19:56:08 +00:00
echo 'export PATH=${makeBinPath [
coreutils
gnused
2017-04-13 14:25:17 +00:00
ucspi-tcp
2017-03-16 20:53:05 +00:00
]}''${PATH+":$PATH"}'
2017-04-13 14:25:17 +00:00
sed 's:^Server=htgen$:&/${version}:' htgen
2017-03-16 19:56:08 +00:00
} > $out/bin/htgen
chmod +x $out/bin/htgen
2017-03-16 20:53:05 +00:00
cp -r examples $out
2017-03-16 19:56:08 +00:00
'';
}