stockholm/krebs/5pkgs/cac/default.nix

40 lines
768 B
Nix
Raw Normal View History

{ stdenv, fetchgit, coreutils, curl, gnused, inotifyTools, jq, ncurses, sshpass, ... }:
2015-08-05 22:21:40 +00:00
stdenv.mkDerivation {
2015-09-26 17:27:01 +00:00
name = "cac-1.0.0";
2015-08-05 22:21:40 +00:00
src = fetchgit {
2015-12-19 15:02:27 +00:00
url = http://cgit.gum/cac;
rev = "fe3b2ecb0aaf7d863842b896e18cd2b829f2297b";
sha256 = "05bnd7wyjhqy8srmpnc8d234rv3jxdjgb4z0hlfb9kg7mb12w1ya";
2015-08-05 22:21:40 +00:00
};
phases = [
"unpackPhase"
"installPhase"
];
installPhase =
let
path = stdenv.lib.makeSearchPath "bin" [
coreutils
curl
gnused
inotifyTools
2015-08-05 22:21:40 +00:00
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
'';
}