2015-08-05 23:01:43 +00:00
|
|
|
{ stdenv, fetchgit, coreutils, curl, gnused, jq, ncurses, sshpass, ... }:
|
2015-08-05 22:21:40 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "cac";
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = http://cgit.cd.retiolum/cac;
|
2015-08-06 17:39:18 +00:00
|
|
|
rev = "f4589158572ab35969b9bccf801ea07e115705e1";
|
|
|
|
sha256 = "9d761cd1d7ff68507392cbfd6c3f6000ddff9cc540293da2b3c4ee902321fb27";
|
2015-08-05 22:21:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
phases = [
|
|
|
|
"unpackPhase"
|
|
|
|
"installPhase"
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase =
|
|
|
|
let
|
|
|
|
path = stdenv.lib.makeSearchPath "bin" [
|
|
|
|
coreutils
|
|
|
|
curl
|
|
|
|
gnused
|
|
|
|
jq
|
2015-08-05 23:01:43 +00:00
|
|
|
ncurses
|
2015-08-05 22:56:28 +00:00
|
|
|
sshpass
|
2015-08-05 22:21:40 +00:00
|
|
|
];
|
|
|
|
in
|
|
|
|
''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
|
|
|
sed \
|
2015-08-05 23:02:49 +00:00
|
|
|
's,^\( true) \)\(cac "$@";;\)$,\1 PATH=${path}${PATH+:$PATH} \2,' \
|
2015-08-05 22:21:40 +00:00
|
|
|
< ./cac \
|
|
|
|
> $out/bin/cac
|
|
|
|
|
|
|
|
chmod +x $out/bin/cac
|
|
|
|
'';
|
|
|
|
}
|