summary refs log tree commit diff
path: root/pkgs/applications/networking/sync/rsync/rrsync.nix
blob: 09f9ab22f335ae7c29db68a0046ec03de2e7a276 (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
{ stdenv, python3, rsync }:

stdenv.mkDerivation {
  pname = "rrsync";
  inherit (rsync) version src;

  buildInputs = [
    rsync
    (python3.withPackages (pythonPackages: with pythonPackages; [ braceexpand ]))
  ];
  # Skip configure and build phases.
  # We just want something from the support directory
  dontConfigure = true;
  dontBuild = true;

  inherit (rsync) patches;

  postPatch = ''
    substituteInPlace support/rrsync --replace /usr/bin/rsync ${rsync}/bin/rsync
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp support/rrsync $out/bin
    chmod a+x $out/bin/rrsync
  '';

  meta = rsync.meta // {
    description = "A helper to run rsync-only environments from ssh-logins";
  };
}