summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/cac-api
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2017-06-01 10:08:56 +0200
committermakefu <github@syntax-fehler.de>2017-06-01 10:08:56 +0200
commit772f84305d90380e0d221cf49ae3f1597d0d0510 (patch)
tree8d2241648396dc34fa96c8c68e12f832fbc7c308 /krebs/5pkgs/simple/cac-api
parent90822f64e0bf247c5cca2f035077553cac5ceb79 (diff)
parent21d92086fe00c7369fde3951f92e9f73f4c05ee9 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/5pkgs/simple/cac-api')
-rw-r--r--krebs/5pkgs/simple/cac-api/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/krebs/5pkgs/simple/cac-api/default.nix b/krebs/5pkgs/simple/cac-api/default.nix
new file mode 100644
index 000000000..e2bd8c148
--- /dev/null
+++ b/krebs/5pkgs/simple/cac-api/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchgit, bc, cac-cert, coreutils, curl, dash, gnugrep, gnused, inotifyTools, jq, ncurses, openssh, sshpass, ... }:
+
+stdenv.mkDerivation {
+ name = "cac-api-1.1.2";
+
+ src = fetchgit {
+ url = http://cgit.ni.krebsco.de/cac-api;
+ rev = "67e93510e7742acae44db30275abbfe671aa9b7b";
+ sha256 = "1vxh57j7vrq5sg9j1sam0538kkkhqpgf230vvdz2ifzgkj01z27l";
+ };
+
+ phases = [
+ "unpackPhase"
+ "installPhase"
+ ];
+
+ installPhase = ''
+ mkdir -p $out/bin
+ { cat <<\EOF
+ #! ${dash}/bin/dash
+ export PATH=${stdenv.lib.makeBinPath [
+ bc
+ coreutils
+ curl
+ gnugrep
+ gnused
+ inotifyTools
+ jq
+ ncurses
+ openssh
+ sshpass
+ ]}:"$PATH"
+ 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-cert} & --cacert /dev/stdin|
+ ' cac-api
+ } > $out/bin/cac-api
+ chmod +x $out/bin/cac-api
+ '';
+}