nixpkgs/pkgs/tools/backup/diskrsync/default.nix
Jaakko Luttinen 0f92afdd6d
diskrsync: fix argv0
When using diskrsync over SSH, on the remote machine it calls an executable
equal to argv0. Typically, this is just diskrsync but now that diskrsync is
wrapped, the wrapper uses absolute path to diskrsync and that path doesn't most
likely work on the remote machine. Thus, we need to force argv0 to "diskrsync"
so that it works on the remote machine.
2018-04-22 22:43:39 +03:00

34 lines
850 B
Nix

{ buildGoPackage, fetchFromGitHub, stdenv, openssh, makeWrapper }:
buildGoPackage rec {
name = "${pname}-${version}";
pname = "diskrsync";
version = "unstable-2018-02-03";
src = fetchFromGitHub {
owner = "dop251";
repo = pname;
rev = "2f36bd6e5084ce16c12a2ee216ebb2939a7d5730";
sha256 = "1rpfk7ds4lpff30aq4d8rw7g9j4bl2hd1bvcwd1pfxalp222zkxn";
};
goPackagePath = "github.com/dop251/diskrsync";
goDeps = ./deps.nix;
buildInputs = [ makeWrapper ];
preFixup = ''
wrapProgram "$bin/bin/diskrsync" --argv0 diskrsync --prefix PATH : ${openssh}/bin
'';
meta = with stdenv.lib; {
description = "Rsync for block devices and disk images";
homepage = https://github.com/dop251/diskrsync;
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ jluttine ];
};
}