bscpkgs/garlic/sh/default.nix

42 lines
709 B
Nix
Raw Normal View History

2020-10-29 17:47:45 +01:00
{
stdenv
, garlicTools
, sshHost
, rsync
, openssh
, nix
, jq
, ncurses
2020-10-29 17:47:45 +01:00
}:
with garlicTools;
let
garlicPrefix = "/mnt/garlic";
2020-10-29 17:47:45 +01:00
in
stdenv.mkDerivation {
name = "garlic-tool";
preferLocalBuild = true;
buildInputs = [ rsync openssh nix jq ncurses ];
2020-10-29 17:47:45 +01:00
phases = [ "unpackPhase" "installPhase" ];
src = ./.;
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
2021-05-11 12:25:15 +02:00
patchShebangs garlic-*
cp garlic-* $out/bin
2020-10-29 17:47:45 +01:00
'';
}