diff options
author | tv <tv@krebsco.de> | 2018-11-28 08:34:19 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2018-11-28 12:45:21 +0100 |
commit | 6f49342b2d5973478f1f5eb6f8d6307059e7bcf7 (patch) | |
tree | 1407762405a66c4f5a0d363a98d7874f769bccad /pkgs | |
parent | d92cc88a3ccfb378d045b35032ee3c0a4f5f860f (diff) |
populate file: add useChecksumv1.8.0
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/populate/default.nix | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix index d24cbec..fad6d18 100644 --- a/pkgs/populate/default.nix +++ b/pkgs/populate/default.nix @@ -20,7 +20,11 @@ let fi ''; - pop.file = target: source: rsync' target (quote source.path); + pop.file = target: source: let + configAttrs = ["useChecksum"]; + config = filterAttrs (name: _: elem name configAttrs) source; + in + rsync' target config (quote source.path); pop.git = target: source: shell' target /* sh */ '' if ! test -e ${quote target.path}; then @@ -78,7 +82,7 @@ let ${coreutils}/bin/touch -d "$pass_date" "$tmp_path" done - ${rsync' target /* sh */ "$tmp_dir"} + ${rsync' target {} /* sh */ "$tmp_dir"} ''; pop.pipe = target: source: /* sh */ '' @@ -100,12 +104,13 @@ let ${pop.${source.type} target' source'} ''; - rsync' = target: sourcePath: /* sh */ '' + rsync' = target: config: sourcePath: /* sh */ '' source_path=${sourcePath} if test -d "$source_path"; then source_path=$source_path/ fi ${rsync}/bin/rsync \ + ${optionalString (config.useChecksum or false) /* sh */ "--checksum"} \ -e ${quote (ssh' target)} \ -vFrlptD \ --delete-excluded \ |