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

44 lines
1.0 KiB
Nix
Raw Normal View History

{ stdenv, fetchgit, bc, cac-cert, coreutils, curl, dash, gnugrep, gnused, inotifyTools, jq, ncurses, openssh, sshpass, ... }:
2015-08-05 22:21:40 +00:00
stdenv.mkDerivation {
2016-02-03 18:39:00 +00:00
name = "cac-api-1.1.0";
2015-08-05 22:21:40 +00:00
src = fetchgit {
2016-02-03 18:39:00 +00:00
url = http://cgit.cd.krebsco.de/cac-api;
rev = "0809fae379239687ed1170e04311dc2880ef0aba";
sha256 = "357ced27c9ed88028967c934178a1d230bf38617a7494cd4632fabdd2a04fcdd";
2015-08-05 22:21:40 +00:00
};
phases = [
"unpackPhase"
"installPhase"
];
installPhase = ''
mkdir -p $out/bin
{ cat <<\EOF
#! ${dash}/bin/dash
export PATH=${stdenv.lib.makeSearchPath "bin" [
bc
coreutils
curl
gnugrep
gnused
inotifyTools
jq
ncurses
openssh
sshpass
]}
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|
' cac-api
} > $out/bin/cac-api
chmod +x $out/bin/cac-api
'';
2015-08-05 22:21:40 +00:00
}