stockholm/krebs/5pkgs/cac.nix

39 lines
747 B
Nix
Raw Normal View History

{ 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
ncurses
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
'';
}