diff options
author | tv <tv@krebsco.de> | 2016-02-04 01:20:03 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-02-04 01:27:59 +0100 |
commit | 48381bd8dd9607d54a936c644964ab5bac90e4a9 (patch) | |
tree | 9503330994463ca348f7a1e61b86a84f101b6599 /krebs/5pkgs/cac-api/default.nix | |
parent | a350db5ce9e3fcf27678a2b9bb6685358b63742a (diff) |
cac-api: don't GET broken listtasks + use complete cert
Diffstat (limited to 'krebs/5pkgs/cac-api/default.nix')
-rw-r--r-- | krebs/5pkgs/cac-api/default.nix | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/krebs/5pkgs/cac-api/default.nix b/krebs/5pkgs/cac-api/default.nix index 2a32bb096..331b0853f 100644 --- a/krebs/5pkgs/cac-api/default.nix +++ b/krebs/5pkgs/cac-api/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, bc, coreutils, curl, gnused, inotifyTools, jq, ncurses, sshpass, ... }: +{ stdenv, fetchgit, bc, coreutils, curl, dash, gnused, inotifyTools, jq, ncurses, openssh, sshpass, ... }: stdenv.mkDerivation { name = "cac-api-1.1.0"; @@ -14,24 +14,29 @@ stdenv.mkDerivation { "installPhase" ]; - installPhase = - let - path = stdenv.lib.makeSearchPath "bin" [ - bc - coreutils - curl - gnused - inotifyTools - jq - ncurses - sshpass - ]; - in - '' - mkdir -p $out/bin - cp cac-api $out/bin/cac-api - sed -i ' - s;^_cac_cli_main .*;PATH=${path}''${PATH+:$PATH} &; - ' $out/bin/cac-api - ''; + installPhase = '' + mkdir -p $out/bin + { cat <<\EOF + #! ${dash}/bin/dash + export PATH=${stdenv.lib.makeSearchPath "bin" [ + bc + coreutils + curl + 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] + s|\<_cac_exec curl|<${./cac.pem} & --cacert /dev/stdin| + ' cac-api + } > $out/bin/cac-api + chmod +x $out/bin/cac-api + ''; } |