2021-06-01 22:33:55 +00:00
|
|
|
{ fetchgit, lib, stdenv
|
2022-09-27 10:24:05 +00:00
|
|
|
, bc, cac-cert, coreutils, curl, dash, gnugrep, gnused, inotify-tools, jq, ncurses, openssh, sshpass
|
2021-06-01 22:33:55 +00:00
|
|
|
}:
|
2015-08-05 22:21:40 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2016-02-22 12:24:03 +00:00
|
|
|
name = "cac-api-1.1.2";
|
2015-08-05 22:21:40 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
2016-11-10 22:15:33 +00:00
|
|
|
url = http://cgit.ni.krebsco.de/cac-api;
|
2016-02-22 12:24:03 +00:00
|
|
|
rev = "67e93510e7742acae44db30275abbfe671aa9b7b";
|
|
|
|
sha256 = "1vxh57j7vrq5sg9j1sam0538kkkhqpgf230vvdz2ifzgkj01z27l";
|
2015-08-05 22:21:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
phases = [
|
|
|
|
"unpackPhase"
|
|
|
|
"installPhase"
|
|
|
|
];
|
|
|
|
|
2016-02-04 00:20:03 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
{ cat <<\EOF
|
|
|
|
#! ${dash}/bin/dash
|
2021-06-01 22:33:55 +00:00
|
|
|
export PATH=${lib.makeBinPath [
|
2016-02-04 00:20:03 +00:00
|
|
|
bc
|
|
|
|
coreutils
|
|
|
|
curl
|
2016-02-11 17:19:56 +00:00
|
|
|
gnugrep
|
2016-02-04 00:20:03 +00:00
|
|
|
gnused
|
2022-09-27 10:24:05 +00:00
|
|
|
inotify-tools
|
2016-02-04 00:20:03 +00:00
|
|
|
jq
|
|
|
|
ncurses
|
|
|
|
openssh
|
|
|
|
sshpass
|
2016-02-22 10:33:51 +00:00
|
|
|
]}:"$PATH"
|
2016-02-04 00:20:03 +00:00
|
|
|
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 00:55:59 +00:00
|
|
|
s|\<_cac_exec curl|<${cac-cert} & --cacert /dev/stdin|
|
2016-02-04 00:20:03 +00:00
|
|
|
' cac-api
|
|
|
|
} > $out/bin/cac-api
|
|
|
|
chmod +x $out/bin/cac-api
|
|
|
|
'';
|
2015-08-05 22:21:40 +00:00
|
|
|
}
|