stockholm/krebs/5pkgs/cac.nix

38 lines
708 B
Nix
Raw Normal View History

{ stdenv, fetchgit, coreutils, curl, gnused, jq, sshpass, ... }:
2015-08-05 22:21:40 +00:00
stdenv.mkDerivation {
name = "cac";
src = fetchgit {
url = http://cgit.cd.retiolum/cac;
2015-08-05 22:59:34 +00:00
rev = "0fc9cbeba4060380f698f51bb74081e2fcefadf3";
sha256 = "9759c78aa9aa04ab82486d0f24264bff1081513bc07cac0f8b3c0bdf52260fb3";
2015-08-05 22:21:40 +00:00
};
phases = [
"unpackPhase"
"installPhase"
];
installPhase =
let
path = stdenv.lib.makeSearchPath "bin" [
coreutils
curl
gnused
jq
sshpass
2015-08-05 22:21:40 +00:00
];
in
''
mkdir -p $out/bin
sed \
's,^\( true) \)\(cac "$@";;\)$,\1 PATH=${path} \2,' \
< ./cac \
> $out/bin/cac
chmod +x $out/bin/cac
'';
}