2020-10-29 17:47:45 +01:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, garlicTools
|
|
|
|
, sshHost
|
|
|
|
, rsync
|
|
|
|
, openssh
|
|
|
|
, nix
|
2021-01-14 12:30:56 +01:00
|
|
|
, jq
|
2021-04-16 09:20:10 +02:00
|
|
|
, ncurses
|
2020-10-29 17:47:45 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
with garlicTools;
|
|
|
|
|
|
|
|
let
|
2020-10-29 18:07:06 +01:00
|
|
|
garlicPrefix = "/mnt/garlic";
|
2020-10-29 17:47:45 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "garlic-tool";
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
2021-04-16 09:20:10 +02:00
|
|
|
buildInputs = [ rsync openssh nix jq ncurses ];
|
2020-10-29 17:47:45 +01:00
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
|
|
|
|
|
|
|
src = ./.;
|
|
|
|
|
2021-02-24 19:45:47 +01:00
|
|
|
inherit garlicPrefix sshHost;
|
2020-10-29 17:47:45 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
substituteAllInPlace garlic
|
|
|
|
substituteInPlace garlic \
|
|
|
|
--replace @PATH@ $PATH
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp garlic $out/bin
|
|
|
|
chmod +x $out/bin/garlic
|
2020-11-05 19:31:21 +01:00
|
|
|
mkdir -p $out/share/man/man1
|
|
|
|
cp garlic.1 $out/share/man/man1
|
2020-10-29 17:47:45 +01:00
|
|
|
'';
|
|
|
|
}
|