stockholm/krebs/5pkgs/cac-api/default.nix

44 lines
1,018 B
Nix
Raw Normal View History

{ stdenv, fetchgit, bc, cac-cert, coreutils, curl, dash, gnugrep, gnused, inotifyTools, jq, ncurses, openssh, sshpass, ... }:
2015-08-06 00:21:40 +02:00
stdenv.mkDerivation {
2016-02-22 13:24:03 +01:00
name = "cac-api-1.1.2";
2015-08-06 00:21:40 +02:00
src = fetchgit {
2016-11-10 23:15:33 +01:00
url = http://cgit.ni.krebsco.de/cac-api;
2016-02-22 13:24:03 +01:00
rev = "67e93510e7742acae44db30275abbfe671aa9b7b";
sha256 = "1vxh57j7vrq5sg9j1sam0538kkkhqpgf230vvdz2ifzgkj01z27l";
2015-08-06 00:21:40 +02:00
};
phases = [
"unpackPhase"
"installPhase"
];
installPhase = ''
mkdir -p $out/bin
{ cat <<\EOF
#! ${dash}/bin/dash
2016-03-03 19:45:46 +01:00
export PATH=${stdenv.lib.makeBinPath [
bc
coreutils
curl
gnugrep
gnused
inotifyTools
jq
ncurses
openssh
sshpass
2016-02-22 11:33:51 +01:00
]}:"$PATH"
EOF
# [1]: Disable fetching tasks; listtasks is currently broken:
# Unknown column 'iod.apitask.cid' in 'field list'
sed '
/^\s*tasks \\$/d; # [1]
2016-02-04 01:55:59 +01:00
s|\<_cac_exec curl|<${cac-cert} & --cacert /dev/stdin|
' cac-api
} > $out/bin/cac-api
chmod +x $out/bin/cac-api
'';
2015-08-06 00:21:40 +02:00
}