about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/backup/diskrsync/default.nix
blob: 5506a197fd1d10592eb08d7e99ae3d786cf66d72 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ buildGoModule, fetchFromGitHub, lib, openssh, makeWrapper }:

buildGoModule rec {
  pname = "diskrsync";
  version = "1.3.0";

  src = fetchFromGitHub {
    owner = "dop251";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-hM70WD+M3jwze0IG84WTFf1caOUk2s9DQ7pR+KNIt1M=";
  };

  vendorHash = "sha256-lJaM/sC5/qmmo7Zu7nGR6ZdXa1qw4SuVxawQ+d/m+Aw=";

  ldflags = [ "-s" "-w" ];

  nativeBuildInputs = [ makeWrapper ];

  preFixup = ''
    wrapProgram "$out/bin/diskrsync" --argv0 diskrsync --prefix PATH : ${openssh}/bin
  '';

  meta = with lib; {
    description = "Rsync for block devices and disk images";
    mainProgram = "diskrsync";
    homepage = "https://github.com/dop251/diskrsync";
    license = licenses.mit;
    maintainers = with maintainers; [ jluttine ];
  };
}