29 lines
441 B
Nix
29 lines
441 B
Nix
|
{
|
||
|
stdenv
|
||
|
, nix
|
||
|
, garlicTool
|
||
|
}:
|
||
|
|
||
|
let
|
||
|
extraPath = "${garlicTool}:${nix}";
|
||
|
in
|
||
|
stdenv.mkDerivation {
|
||
|
name = "garlicd";
|
||
|
preferLocalBuild = true;
|
||
|
|
||
|
phases = [ "unpackPhase" "installPhase" ];
|
||
|
|
||
|
src = ./garlicd;
|
||
|
|
||
|
unpackPhase = ''
|
||
|
cp $src garlicd
|
||
|
'';
|
||
|
|
||
|
installPhase = ''
|
||
|
substituteInPlace garlicd \
|
||
|
--replace @extraPath@ ${extraPath}
|
||
|
mkdir -p $out/bin
|
||
|
cp -a garlicd $out/bin
|
||
|
'';
|
||
|
}
|